diff options
Diffstat (limited to 'app/Env.hs')
| -rw-r--r-- | app/Env.hs | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,23 +1,23 @@ module Env where -import Code (InterpFn, PrlgEnv) +import Code (Id(..), InterpFn, PrlgEnv) import CodeLens -import qualified IR +import IR (StrTable, strtablize) import Lens.Micro.Mtl -withStrTable :: (IR.StrTable -> (IR.StrTable, a)) -> Env.PrlgEnv a +withStrTable :: (StrTable -> (StrTable, a)) -> Env.PrlgEnv a withStrTable f = do (st', x) <- f <$> use strtable strtable .= st' return x -findStruct :: String -> Int -> Env.PrlgEnv IR.Id +findStruct :: String -> Int -> Env.PrlgEnv Id findStruct str arity = do stri <- findAtom str - return IR.Id {IR.str = stri, IR.arity = arity} + return Id {str = stri, arity = arity} findAtom :: String -> Env.PrlgEnv Int -findAtom = withStrTable . flip IR.strtablize +findAtom = withStrTable . flip strtablize type PrlgEnv a = Code.PrlgEnv a |
