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:
parent
6abf2a85fe
commit
27c2f6603b
@ -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))
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user