aboutsummaryrefslogtreecommitdiffstats
path: root/src/Utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils.hs')
-rw-r--r--src/Utils.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Utils.hs b/src/Utils.hs
index 127e7c0..e4b2333 100644
--- a/src/Utils.hs
+++ b/src/Utils.hs
@@ -29,8 +29,12 @@ data Config = Config {
configPrintCallStack :: Bool,
configUseREPL :: Bool
}
+data Binding a
+ = Regular a
+ | Memoized (M.Map [a] a) a
+ deriving Show
-type Env = M.Map String AST
+type Env = M.Map String (Binding AST)
type Scope = [(String, AST)]
data LState = LState {
@@ -61,7 +65,7 @@ putEnv :: Env -> LContext ()
putEnv env = do
modify (\s -> s { stateEnv = env })
-insertEnv :: String -> AST -> LContext ()
+insertEnv :: String -> Binding AST -> LContext ()
insertEnv k v = do
env <- getEnv
putEnv $ M.insert k v env