aboutsummaryrefslogtreecommitdiff
path: root/bin/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'bin/Main.hs')
-rw-r--r--bin/Main.hs8
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 @@
1module Main where 1module Main where
2 2
3import Base (Expr (..))
3import Control.Monad (liftM) 4import Control.Monad (liftM)
4import Control.Monad.Except (liftIO, runExceptT, throwError) 5import Control.Monad.Except (liftIO, runExceptT, throwError)
5import Environment 6import Environment
@@ -7,7 +8,7 @@ import Error.Base (LispError (..), LispResult (..),
7 unwrap) 8 unwrap)
8import Error.Pretty (defaults, showError) 9import Error.Pretty (defaults, showError)
9import Evaluator (eval) 10import Evaluator (eval)
10import Parser (Expr (..), parseLispValue) 11import Parser (parseLispValue)
11import System.Console.Readline 12import System.Console.Readline
12import System.Environment (getArgs) 13import System.Environment (getArgs)
13import Text.ParserCombinators.Parsec 14import 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
35main :: IO () 39main :: IO ()