diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-08-20 14:47:15 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-08-20 14:47:15 +0200 |
commit | c36fd5a174ab74465b8562c5fb4fa69a25dfca79 (patch) | |
tree | cebd29dfb75e4713934a995ad13b957769194e7d /Main.hs | |
parent | f8d264f2b18fccdc3b96d8fb66656128a25137f2 (diff) |
Fourth
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 |