diff --git a/app/Frontend.hs b/app/Frontend.hs index b1ae79a..eac4e89 100644 --- a/app/Frontend.hs +++ b/app/Frontend.hs @@ -33,16 +33,16 @@ interpret = (>> return True) . lex where lex input = do case MP.parse P.lexPrlg "-" input of - Left bundle -> liftIO $ putStr (MP.errorBundlePretty bundle) + Left bundle -> lift . outputStr $ MP.errorBundlePretty bundle Right toks -> parse toks parse toks = do case MP.parse P.parsePrlg "-" toks of - Left bundle -> liftIO $ putStr (MP.errorBundlePretty bundle) + Left bundle -> lift . outputStr $ MP.errorBundlePretty bundle Right asts -> traverse_ shunt asts shunt ast = do o <- gets ops case P.shuntPrlg o ast of - Left err -> liftIO $ putStrLn $ "expression parsing: " ++ err + Left err -> lift . outputStrLn $ "expression parsing: " ++ err Right prlg -> intern prlg intern prlgs = do prlgi <- withStrTable $ \st -> C.internPrlg st prlgs @@ -58,14 +58,13 @@ interpret = (>> return True) . lex execute code execute code = do res <- I.prove code - case res of - Left err -> liftIO $ putStrLn err - Right res -> - liftIO $ - putStrLn $ - if res - then "yes." - else "no proof." + lift . outputStrLn $ + case res of + Left err -> err + Right res -> + if res + then "yes." + else "no proof." interpreterStart :: PrlgEnv () interpreterStart = do