diff options
Diffstat (limited to 'app/Main.hs')
-rw-r--r-- | app/Main.hs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/app/Main.hs b/app/Main.hs index de1c1ab..efe495b 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,6 +1,18 @@ module Main where -import Lib +import Syntax +import Typecheck +import Eval +import Control.Monad.Except main :: IO () -main = someFunc +main = do + input <-getContents + let program = (read input)::Program + case runExcept $ wfProgram program of + Left s -> print s + Right () -> + let (ret,state) = runProgram program in + case ret of + Left err-> print$ "Program finished with error" ++show err ++ "in state " ++ show state + Right _ -> print$ "Program finished by going to the end to state" ++ show state |