diff options
author | Marvin Borner | 2022-03-04 01:50:03 +0100 |
---|---|---|
committer | Marvin Borner | 2022-03-04 01:50:03 +0100 |
commit | 67978b6da9092a37921da6351a82d46a74ca3515 (patch) | |
tree | f1f4acbb91e91838c39906998b5d561d4977c8ee | |
parent | dbfb7c4f285fda49c59648ef16c6d6bfdd4e59bd (diff) |
LOL
-rw-r--r-- | src/Fun/Compiler.hs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/Fun/Compiler.hs b/src/Fun/Compiler.hs index a118103..6a4f8e1 100644 --- a/src/Fun/Compiler.hs +++ b/src/Fun/Compiler.hs @@ -40,17 +40,12 @@ check t = case checkTree t of where join = foldr (\(SyntaxError a) b -> a ++ if b == "" then b else "\n" ++ b) "" --- TODO: Find higher-order infix -f <~ e = case e of - Left e -> Left e - Right e -> f e - compile :: String -> IO () compile path = do file <- try $ readFile path case file of Left exception -> print (exception :: IOError) - Right file -> case check <~ parse file of + Right file -> case parse file >>= check of Left err -> do hPutStrLn stderr err exitWith (ExitFailure 1) |