module Main where import System.IO (hFlush, stdout) import Text.Parsec (parse) import Core import Parser repl :: IO () repl = do putStr "arith> " hFlush stdout line <- getLine if line == ":q" then putStrLn "Bye!" else do case parse parseProgram "" line of Left err -> print err Right term -> print (eval term) repl main :: IO () main = repl