From 0092723895da4136a68f71f34a816b33586d9ccb Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Sun, 26 Feb 2023 21:43:25 +0100 Subject: microlens and an ugly parse of ,(something,something) btw we triggered a ghc bug here with iscallTok in parser. Apparently it kills `call` for whichever reason. New ghc solved it. --- app/Interpreter.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/Interpreter.hs') diff --git a/app/Interpreter.hs b/app/Interpreter.hs index 8531a27..0107bf5 100644 --- a/app/Interpreter.hs +++ b/app/Interpreter.hs @@ -19,8 +19,8 @@ import qualified Data.Map as M import Env (PrlgEnv) import Heap import IR (Id(..), StrTable(..)) -import Lens.Family2 -import Lens.Family2.State +import Lens.Micro +import Lens.Micro.Mtl prove :: Code -> PrlgEnv (Either String Bool) prove g = do @@ -140,7 +140,7 @@ cutGoal = doCut >> advance openGoal :: IR.Id -> InterpFn openGoal fn = do - def <- defs `uses` (M.!? fn) + def <- (M.!? fn) <$> use defs case def of Just hs@(_:_) -> do advance @@ -293,7 +293,7 @@ unify _ _ = backtrack {- unification reference-handling tools -} findLocalRef :: Lens' Cho (M.Map Int Int) -> Int -> PrlgEnv Int findLocalRef store lr = do - a' <- (cur . store) `uses` (M.!? lr) + a' <- (M.!? lr) <$> use (cur . store) case a' of Nothing -> do a <- newHeapVar -- cgit v1.2.3