diff options
Diffstat (limited to 'src/Evaluator.hs')
-rw-r--r-- | src/Evaluator.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Evaluator.hs b/src/Evaluator.hs index 9e6632e..3bc1e09 100644 --- a/src/Evaluator.hs +++ b/src/Evaluator.hs | |||
@@ -1,5 +1,6 @@ | |||
1 | module Evaluator (eval) where | 1 | module Evaluator (eval) where |
2 | 2 | ||
3 | import Base | ||
3 | import Control.Applicative ((*>)) | 4 | import Control.Applicative ((*>)) |
4 | import Control.Arrow ((&&&)) | 5 | import Control.Arrow ((&&&)) |
5 | import Control.Monad.Except | 6 | import Control.Monad.Except |
@@ -7,7 +8,6 @@ import Environment | |||
7 | import Error.Base (LispError (..), LispResult (..), | 8 | import Error.Base (LispError (..), LispResult (..), |
8 | unwrap) | 9 | unwrap) |
9 | import Operators | 10 | import Operators |
10 | import Parser | ||
11 | import Text.ParserCombinators.Parsec | 11 | import Text.ParserCombinators.Parsec |
12 | 12 | ||
13 | apply :: String -> [Expr] -> LispResult Expr | 13 | apply :: String -> [Expr] -> LispResult Expr |
@@ -20,6 +20,7 @@ evalUnquoteSplicing :: Env -> Expr -> IOResult Expr | |||
20 | evalUnquoteSplicing env (List xs) = List <$> mapM (eval env) xs | 20 | evalUnquoteSplicing env (List xs) = List <$> mapM (eval env) xs |
21 | evalUnquoteSplicing env literal = return literal | 21 | evalUnquoteSplicing env literal = return literal |
22 | 22 | ||
23 | -- might be worth including unquote and unquote-splicing in lisk's prelude | ||
23 | evalUnquote :: Env -> Expr -> IOResult Expr | 24 | evalUnquote :: Env -> Expr -> IOResult Expr |
24 | evalUnquote env (DottedList h t) = List . (:[]) <$> liftM2 DottedList (mapM (evalUnquote env) h) (evalUnquote env t) | 25 | evalUnquote env (DottedList h t) = List . (:[]) <$> liftM2 DottedList (mapM (evalUnquote env) h) (evalUnquote env t) |
25 | evalUnquote env (Vector vs) = List . (:[]) . Vector <$> mapM (evalUnquote env) vs | 26 | evalUnquote env (Vector vs) = List . (:[]) . Vector <$> mapM (evalUnquote env) vs |