diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/Main.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/Main.hs b/bin/Main.hs index 18e1c53..3d9fad4 100644 --- a/bin/Main.hs +++ b/bin/Main.hs | |||
@@ -1,5 +1,6 @@ | |||
1 | module Main where | 1 | module Main where |
2 | 2 | ||
3 | import Base (Expr (..)) | ||
3 | import Control.Monad (liftM) | 4 | import Control.Monad (liftM) |
4 | import Control.Monad.Except (liftIO, runExceptT, throwError) | 5 | import Control.Monad.Except (liftIO, runExceptT, throwError) |
5 | import Environment | 6 | import Environment |
@@ -7,7 +8,7 @@ import Error.Base (LispError (..), LispResult (..), | |||
7 | unwrap) | 8 | unwrap) |
8 | import Error.Pretty (defaults, showError) | 9 | import Error.Pretty (defaults, showError) |
9 | import Evaluator (eval) | 10 | import Evaluator (eval) |
10 | import Parser (Expr (..), parseLispValue) | 11 | import Parser (parseLispValue) |
11 | import System.Console.Readline | 12 | import System.Console.Readline |
12 | import System.Environment (getArgs) | 13 | import System.Environment (getArgs) |
13 | import Text.ParserCombinators.Parsec | 14 | import Text.ParserCombinators.Parsec |
@@ -29,7 +30,10 @@ repl env = do | |||
29 | case inp of | 30 | case inp of |
30 | Nothing -> return () | 31 | Nothing -> return () |
31 | Just ",q" -> return () | 32 | Just ",q" -> return () |
32 | Just i -> evalExpr env i >>= either (putStrLn . pp i) putStrLn >> repl env | 33 | Just i -> do |
34 | addHistory i | ||
35 | evalExpr env i >>= either (putStrLn . pp i) putStrLn | ||
36 | repl env | ||
33 | 37 | ||
34 | 38 | ||
35 | main :: IO () | 39 | main :: IO () |