mirror of
https://github.com/github/semantic.git
synced 2024-12-19 12:51:52 +03:00
🔥 withDefaultEnvironment.
This commit is contained in:
parent
78c32db271
commit
d2e9974a0c
@ -5,7 +5,6 @@ module Control.Abstract.Environment
|
||||
, putEnv
|
||||
, modifyEnv
|
||||
, withEnv
|
||||
, withDefaultEnvironment
|
||||
, localEnv
|
||||
, localize
|
||||
, lookupEnv
|
||||
@ -41,11 +40,6 @@ withEnv :: Member (State (Environment location)) effects => Environment location
|
||||
withEnv = localState . const
|
||||
|
||||
|
||||
-- | Set the default environment for the lifetime of an action.
|
||||
-- Usually only invoked in a top-level evaluation function.
|
||||
withDefaultEnvironment :: Member (Reader (Environment location)) effects => Environment location -> Evaluator location value effects a -> Evaluator location value effects a
|
||||
withDefaultEnvironment e = local (const e)
|
||||
|
||||
-- | Run an action with a locally-modified environment.
|
||||
localEnv :: Member (State (Environment location)) effects => (Environment location -> Environment location) -> Evaluator location value effects a -> Evaluator location value effects a
|
||||
localEnv f a = do
|
||||
|
Loading…
Reference in New Issue
Block a user