aboutsummaryrefslogtreecommitdiff
path: root/src/Haskell/Env/Context.hs
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2019-04-09 23:30:08 +0200
committerTom Smeding <tom.smeding@gmail.com>2019-04-09 23:30:08 +0200
commit573967434a8b1cb14ee7de43ec11bd616cf568c6 (patch)
tree3b88b0e275fbeed9b853e9ba32fca6cf5a2367eb /src/Haskell/Env/Context.hs
parentb9494feebfabec0db65ee1b0e77cbd2d0d740470 (diff)
Organisation cleanup
Diffstat (limited to 'src/Haskell/Env/Context.hs')
-rw-r--r--src/Haskell/Env/Context.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Haskell/Env/Context.hs b/src/Haskell/Env/Context.hs
new file mode 100644
index 0000000..2e6b6cc
--- /dev/null
+++ b/src/Haskell/Env/Context.hs
@@ -0,0 +1,15 @@
+module Haskell.Env.Context where
+
+import Haskell.Env
+import Haskell.Env.Cmd
+
+
+data Context = Context { cStack :: [(Action, Env)], cBaseEnv :: Env }
+ deriving (Show)
+
+topEnv :: Context -> Env
+topEnv (Context [] env) = env
+topEnv (Context ((_, env):_) _) = env
+
+pushCtx :: (Action, Env) -> Context -> Context
+pushCtx pair ctx = ctx { cStack = pair : cStack ctx }