From 8f47919624f0153ff9afa299d994d66bb63037ef Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Fri, 4 Nov 2022 17:56:31 +0100 Subject: better shunting errors --- app/Main.hs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'app/Main.hs') diff --git a/app/Main.hs b/app/Main.hs index 88b1782..5dfb25e 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -19,8 +19,8 @@ ppr = , outputOptionsPageWidth = 80 } -interpret :: String -> InputT IO () -interpret = liftIO . lex +interpret :: String -> IO () +interpret = lex where lex input = case MP.parse P.lexPrlg "-" input of @@ -34,15 +34,13 @@ interpret = liftIO . lex main :: IO () main = - runInputT defaultSettings $ do - outputStrLn "PRLG." - loop + runInputT defaultSettings loop where loop :: InputT IO () loop = do - minput <- getInputLine "|= " + minput <- getInputLine "prlg> " case minput of Nothing -> return () Just input -> do - interpret input + liftIO $ interpret input loop -- cgit v1.2.3