packages feed

KiCS-0.8.8: src/kics.hs

import System

import Curry.Compiler.Config
import Curry.Compiler.CurryToHaskell
import Curry.Compiler.SafeCalls

import System.Environment

-------------------------------
-- the kics compiler
-------------------------------

main :: IO ()
main = do 
  (opts,_) <- getOptions 
  if null (filename opts)
   then usage "no file to compile"
   else do
      safe (startCompilation opts) >>=
        maybe (error "error during compilaton") (\_ -> return ())
      let call = ghcCall opts{filename=inKicsSubdir "Main.hs"}
      if executable opts 
        then do 
              putStrLn ("compiling executable "++maybe "" id (target opts)) 
              if verbosity opts >= 3 then putStrLn call else return () 
              system call
        else return undefined
      return ()