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

Define a method to ask for the current module stack.

This commit is contained in:
Rob Rix 2018-03-22 12:29:06 -04:00
parent 6abf2a85fe
commit 27c2f6603b
3 changed files with 7 additions and 0 deletions

View File

@ -26,6 +26,8 @@ instance ( Effectful (m term value)
=> MonadEvaluator term value (Collecting m term value effects) where
getConfiguration term = Configuration term <$> askRoots <*> getEnv <*> getHeap
askModuleStack = Collecting askModuleStack
instance ( Effectful (m term value)
, Foldable (Cell (LocationFor value))

View File

@ -76,6 +76,8 @@ instance Members '[Reader (ModuleTable [Module term]), State (ModuleTable (Envir
instance Members (EvaluatingEffects term value) effects => MonadEvaluator term value (Evaluating term value effects) where
getConfiguration term = Configuration term mempty <$> getEnv <*> getHeap
askModuleStack = raise ask
instance ( Evaluatable (Base term)
, FreeVariables term
, Members (EvaluatingEffects term value) effects

View File

@ -43,6 +43,9 @@ class ( MonadControl term m
-- | Get the current 'Configuration' with a passed-in term.
getConfiguration :: Ord (LocationFor value) => term -> m (ConfigurationFor term value)
askModuleStack :: m [Module term]
-- | A 'Monad' abstracting local and global environments.
class Monad m => MonadEnvironment value m | m -> value where
-- | Retrieve the environment.