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