1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 21:01:35 +03:00

lookupEnv is an Env request.

This commit is contained in:
Rob Rix 2018-05-29 17:03:22 -04:00
parent 6535eebf0a
commit afc99742c6

View File

@ -69,8 +69,8 @@ localize :: Member (State (Environment location)) effects => Evaluator location
localize = localEnv id
-- | Look a 'Name' up in the current environment, trying the default environment if no value is found.
lookupEnv :: (Member (Reader (Environment location)) effects, Member (State (Environment location)) effects) => Name -> Evaluator location value effects (Maybe (Address location value))
lookupEnv name = (<|>) <$> (Env.lookup name <$> getEnv) <*> (Env.lookup name <$> defaultEnvironment)
lookupEnv :: Member (Env location) effects => Name -> Evaluator location value effects (Maybe (Address location value))
lookupEnv name = fmap Address <$> send (Lookup name)
data Env location return where