From f6cd19ddb9f5455de22cf9a3a9f8dfe32e491e42 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 6 Mar 2018 17:24:14 -0500 Subject: [PATCH] Add askRoots to the MonadEvaluator interface with a default definition. --- src/Control/Abstract/Evaluator.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Control/Abstract/Evaluator.hs b/src/Control/Abstract/Evaluator.hs index 6cc38715a..b6e59982d 100644 --- a/src/Control/Abstract/Evaluator.hs +++ b/src/Control/Abstract/Evaluator.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DataKinds, FunctionalDependencies, GeneralizedNewtypeDeriving, RankNTypes, StandaloneDeriving, UndecidableInstances #-} +{-# LANGUAGE DataKinds, DefaultSignatures, FunctionalDependencies, GeneralizedNewtypeDeriving, RankNTypes, StandaloneDeriving, UndecidableInstances #-} module Control.Abstract.Evaluator where import Control.Applicative @@ -10,6 +10,7 @@ import Control.Monad.Effect.Reader import Control.Monad.Effect.State import Data.Abstract.Configuration import Data.Abstract.Linker +import Data.Abstract.Live import Data.Abstract.Value import Prelude hiding (fail) @@ -45,6 +46,10 @@ class MonadFail m => MonadEvaluator term value m | m -> term, m -> value where -- | Run an action with a locally-modified table of unevaluated modules. localModuleTable :: (Linker term -> Linker term) -> m a -> m a + -- | Retrieve the current root set. + askRoots :: Ord (LocationFor value) => m (Live (LocationFor value) value) + askRoots = pure mempty + -- | Get the current 'Configuration' with a passed-in term. getConfiguration :: Ord (LocationFor value) => term -> m (Configuration (LocationFor value) term value) getConfiguration term = Configuration term mempty <$> askLocalEnv <*> getStore