about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Main.hs16
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