1
1
mirror of https://github.com/github/semantic.git synced 2025-01-06 23:46:21 +03:00

🔥 withModules.

This commit is contained in:
Rob Rix 2018-03-30 19:09:37 -04:00
parent 5cf9dc20af
commit aed9457896

View File

@ -9,9 +9,8 @@ module Data.Abstract.Evaluatable
, variable
, evaluateTerm
, evaluateModule
, evaluatePackage
, withModules
, evaluateModules
, evaluatePackage
, throwLoadError
, require
, load
@ -172,14 +171,6 @@ evaluateModule :: MonadEvaluatable location term value m
-> m value
evaluateModule m = analyzeModule (subtermValue . moduleBody) (fmap (Subterm <*> evaluateTerm) m)
-- | Run an action with the a list of 'Module's available for imports.
withModules :: MonadEvaluatable location term value m
=> [Module term]
-> m a
-> m a
withModules = localModuleTable . const . ModuleTable.fromModules
-- | Evaluate with a list of modules in scope, taking the head module as the entry point.
evaluateModules :: ( Effectful m
, Member (Reader (SomeOrigin term)) effects