From 63a5bf4b2588fe58dbc9ec9f3ed336cfc9f9e261 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 11 Dec 2018 13:41:52 -0500 Subject: [PATCH] Factor perModule into runInModule. --- src/Semantic/Analysis.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Semantic/Analysis.hs b/src/Semantic/Analysis.hs index 733491b22..569376e64 100644 --- a/src/Semantic/Analysis.hs +++ b/src/Semantic/Analysis.hs @@ -95,7 +95,7 @@ evaluate lang perModule runTerm modules = do _ -> mempty scopeAddress <- newScope scopeEdges frameAddress <- newFrame scopeAddress frameLinks - val <- runInModule scopeAddress frameAddress (perModule (runValueEffects . moduleBody) m) + val <- runInModule scopeAddress frameAddress m pure ((scopeAddress, frameAddress), val) where runInModule scopeAddress frameAddress = runDeref @@ -103,6 +103,7 @@ evaluate lang perModule runTerm modules = do . raiseHandler (runReader (CurrentScope scopeAddress)) . runReturn . runLoopControl + . perModule (runValueEffects . moduleBody) runValueEffects = raiseHandler runInterpose . runBoolean . runWhile . runFunction runTerm . either ((unit <$) . definePrelude) runTerm