mirror of
https://github.com/github/semantic.git
synced 2024-12-29 18:06:14 +03:00
🔥 putEnv.
This commit is contained in:
parent
10d9454895
commit
19d4ebefa4
@ -94,7 +94,6 @@ convergingModules recur m = do
|
|||||||
c <- getConfiguration (subterm (moduleBody m))
|
c <- getConfiguration (subterm (moduleBody m))
|
||||||
-- Convergence here is predicated upon an Eq instance, not α-equivalence
|
-- Convergence here is predicated upon an Eq instance, not α-equivalence
|
||||||
cache <- converge lowerBound (\ prevCache -> isolateCache $ raiseHandler locally $ do
|
cache <- converge lowerBound (\ prevCache -> isolateCache $ raiseHandler locally $ do
|
||||||
TermEvaluator (putEnv (configurationEnvironment c))
|
|
||||||
TermEvaluator (putHeap (configurationHeap c))
|
TermEvaluator (putHeap (configurationHeap c))
|
||||||
-- We need to reset fresh generation so that this invocation converges.
|
-- We need to reset fresh generation so that this invocation converges.
|
||||||
resetFresh 0 $
|
resetFresh 0 $
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
module Control.Abstract.Environment
|
module Control.Abstract.Environment
|
||||||
( Environment
|
( Environment
|
||||||
, getEnv
|
, getEnv
|
||||||
, putEnv
|
|
||||||
, lookupEnv
|
, lookupEnv
|
||||||
, bind
|
, bind
|
||||||
, bindAll
|
, bindAll
|
||||||
@ -28,10 +27,6 @@ import Prologue
|
|||||||
getEnv :: Member (Env address) effects => Evaluator address value effects (Environment address)
|
getEnv :: Member (Env address) effects => Evaluator address value effects (Environment address)
|
||||||
getEnv = send GetEnv
|
getEnv = send GetEnv
|
||||||
|
|
||||||
-- | Set the environment.
|
|
||||||
putEnv :: Member (Env address) effects => Environment address -> Evaluator address value effects ()
|
|
||||||
putEnv = send . PutEnv
|
|
||||||
|
|
||||||
|
|
||||||
-- | Look a 'Name' up in the current environment, trying the default environment if no value is found.
|
-- | Look a 'Name' up in the current environment, trying the default environment if no value is found.
|
||||||
lookupEnv :: Member (Env address) effects => Name -> Evaluator address value effects (Maybe address)
|
lookupEnv :: Member (Env address) effects => Name -> Evaluator address value effects (Maybe address)
|
||||||
@ -62,7 +57,6 @@ data Env address return where
|
|||||||
Push :: Env address ()
|
Push :: Env address ()
|
||||||
Pop :: Env address ()
|
Pop :: Env address ()
|
||||||
GetEnv :: Env address (Environment address)
|
GetEnv :: Env address (Environment address)
|
||||||
PutEnv :: Environment address -> Env address ()
|
|
||||||
|
|
||||||
handleEnv :: forall address effects value result
|
handleEnv :: forall address effects value result
|
||||||
. Member (State (Environment address)) effects
|
. Member (State (Environment address)) effects
|
||||||
@ -75,7 +69,6 @@ handleEnv = \case
|
|||||||
Push -> modify (Env.push @address)
|
Push -> modify (Env.push @address)
|
||||||
Pop -> modify (Env.pop @address)
|
Pop -> modify (Env.pop @address)
|
||||||
GetEnv -> get
|
GetEnv -> get
|
||||||
PutEnv e -> put e
|
|
||||||
|
|
||||||
runEnv :: Member (State (Environment address)) effects
|
runEnv :: Member (State (Environment address)) effects
|
||||||
=> Evaluator address value (Env address ': effects) a
|
=> Evaluator address value (Env address ': effects) a
|
||||||
|
Loading…
Reference in New Issue
Block a user