module Main where import Calculator.Evaluator (eval) import Calculator.Primitives (result) import System.Console.Haskeline type Repl a = InputT IO a process :: String -> Repl () process input = outputStrLn $ result $ eval input repl :: Repl () repl = do input <- getInputLine "calc> " case input of Nothing -> return () Just inp -> process inp >> repl main :: IO () main = runInputT defaultSettings repl