mirror of
https://github.com/github/semantic.git
synced 2024-12-30 02:14:20 +03:00
Generalize lookupWith.
This commit is contained in:
parent
a7306d9f73
commit
56c67158cf
@ -162,7 +162,7 @@ lookupEnv :: (Evaluator location term value m, Members '[Reader (Environment loc
|
||||
lookupEnv name = (<|>) <$> (Env.lookup name <$> getEnv) <*> (Env.lookup name <$> defaultEnvironment)
|
||||
|
||||
-- | Look up a 'Name' in the environment, running an action with the resolved address (if any).
|
||||
lookupWith :: MonadEvaluator location term value effects m => (Address location value -> m effects a) -> Name -> m effects (Maybe a)
|
||||
lookupWith :: (Evaluator location term value m, Members '[Reader (Environment location value), State (Environment location value)] effects, Monad (m effects)) => (Address location value -> m effects a) -> Name -> m effects (Maybe a)
|
||||
lookupWith with name = do
|
||||
addr <- lookupEnv name
|
||||
maybe (pure Nothing) (fmap Just . with) addr
|
||||
|
Loading…
Reference in New Issue
Block a user