diff options
Diffstat (limited to 'Main.hs')
-rw-r--r-- | Main.hs | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -28,11 +28,8 @@ tracePrettyId x = trace (pretty x) x eitherToIO :: Either String a -> IO a eitherToIO = either die return - -main :: IO () -main = do - source <- getContents - +performCompile :: String -> IO () +performCompile source = do let eres = return source >>= parseProgram <?> "Parse error" >>= typeCheck <?> "Type error" @@ -53,3 +50,6 @@ main = do hPutStrLn stderr "Linking with ld..." callCommand "ld z_output.o liblang.o -o z_output" + +main :: IO () +main = getContents >>= performCompile |