mirror of
https://github.com/github/semantic.git
synced 2024-12-27 17:05:33 +03:00
Use withModules to define evaluates.
This commit is contained in:
parent
111e31e4da
commit
529becae3f
@ -57,8 +57,7 @@ evaluates :: forall v term
|
|||||||
=> [(Blob, term)] -- List of (blob, term) pairs that make up the program to be evaluated
|
=> [(Blob, term)] -- List of (blob, term) pairs that make up the program to be evaluated
|
||||||
-> (Blob, term) -- Entrypoint
|
-> (Blob, term) -- Entrypoint
|
||||||
-> Final (EvaluationEffects term v) v
|
-> Final (EvaluationEffects term v) v
|
||||||
evaluates pairs (_, t) = run @(EvaluationEffects term v) (runEvaluator (runEvaluation (localModuleTable (const moduleTable) (evaluateTerm t))))
|
evaluates pairs (_, t) = run @(EvaluationEffects term v) (runEvaluator (runEvaluation (withModules pairs (evaluateTerm t))))
|
||||||
where moduleTable = Linker (Map.fromList (map (first (dropExtensions . blobPath)) pairs))
|
|
||||||
|
|
||||||
withModules :: (MonadAnalysis term value m, MonadEvaluator term value m) => [(Blob, term)] -> m a -> m a
|
withModules :: (MonadAnalysis term value m, MonadEvaluator term value m) => [(Blob, term)] -> m a -> m a
|
||||||
withModules pairs = localModuleTable (const moduleTable)
|
withModules pairs = localModuleTable (const moduleTable)
|
||||||
|
Loading…
Reference in New Issue
Block a user