there's outputStrLn
This commit is contained in:
parent
e074e454d5
commit
fdf96f5a77
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue