1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00

Define local modification to the environment.

This commit is contained in:
Rob Rix 2018-02-28 10:42:27 -05:00
parent 55a2b3f8dc
commit 6ad1d024f2

View File

@ -21,6 +21,9 @@ modifyGlobalEnv f = Evaluator (modify f)
askLocalEnv :: Evaluator effects value (EnvironmentFor value)
askLocalEnv = Evaluator ask
localEnv :: (EnvironmentFor value -> EnvironmentFor value) -> Evaluator effects value a -> Evaluator effects value a
localEnv f a = Evaluator (local f (runEvaluator a))
data Evaluator effects value a
= Evaluator