From 0f7188a864769fce964a2e27185a7f10da0331a1 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 19 Dec 2019 14:30:24 -0500 Subject: [PATCH] Run the Domain effect. --- semantic-analysis/src/Analysis/ImportGraph.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/semantic-analysis/src/Analysis/ImportGraph.hs b/semantic-analysis/src/Analysis/ImportGraph.hs index 64d760b97..68b0b4eb2 100644 --- a/semantic-analysis/src/Analysis/ImportGraph.hs +++ b/semantic-analysis/src/Analysis/ImportGraph.hs @@ -99,9 +99,12 @@ runFile eval file = traverse run file . runEnv . runFail . fmap fold - . convergeTerm 0 (A.runHeap @Addr @(Value (Semi term)) . fix (cacheTerm . eval)) + . convergeTerm 0 (A.runHeap @Addr @(Value (Semi term)) . fix (\ eval' -> runDomain eval' . fix (cacheTerm . eval))) +runDomain :: (term Addr -> m (Value (Semi term))) -> DomainC term m a -> m a +runDomain eval (DomainC m) = runReader eval m + newtype DomainC term m a = DomainC (ReaderC (term Addr -> m (Value (Semi term))) m a) deriving (Alternative, Applicative, Functor, Monad, MonadFail)