diff options
Diffstat (limited to 'app/Env.hs')
| -rw-r--r-- | app/Env.hs | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,14 +1,14 @@ module Env where -import Code (Interp(..), InterpFn, PrlgEnv) -import Control.Monad.Trans.State.Lazy (gets, modify) +import Code (InterpFn, PrlgEnv) +import CodeLens import qualified IR +import Lens.Family2.State withStrTable :: (IR.StrTable -> (IR.StrTable, a)) -> Env.PrlgEnv a withStrTable f = do - st <- gets strtable - let (st', x) = f st - modify (\s -> s {strtable = st'}) + (st', x) <- strtable `uses` f + strtable .= st' return x findStruct :: String -> Int -> Env.PrlgEnv IR.Id |
