From 529becae3f3c56e1d74ae44b804377c9fb61a475 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 2 Mar 2018 12:26:46 -0500 Subject: [PATCH] Use withModules to define evaluates. --- src/Analysis/Abstract/Evaluating.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Analysis/Abstract/Evaluating.hs b/src/Analysis/Abstract/Evaluating.hs index 7c8c99837..d1c5c8728 100644 --- a/src/Analysis/Abstract/Evaluating.hs +++ b/src/Analysis/Abstract/Evaluating.hs @@ -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) -- Entrypoint -> Final (EvaluationEffects term v) v -evaluates pairs (_, t) = run @(EvaluationEffects term v) (runEvaluator (runEvaluation (localModuleTable (const moduleTable) (evaluateTerm t)))) - where moduleTable = Linker (Map.fromList (map (first (dropExtensions . blobPath)) pairs)) +evaluates pairs (_, t) = run @(EvaluationEffects term v) (runEvaluator (runEvaluation (withModules pairs (evaluateTerm t)))) withModules :: (MonadAnalysis term value m, MonadEvaluator term value m) => [(Blob, term)] -> m a -> m a withModules pairs = localModuleTable (const moduleTable)