From 0ae579d7c56c1f1962f2de308a56c85778b0c611 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 1 Aug 2018 12:05:25 -0400 Subject: [PATCH] Prompt before evaluating each term. Co-Authored-By: Ayman Nadeem --- src/Semantic/REPL.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Semantic/REPL.hs b/src/Semantic/REPL.hs index 4dacbd3c5..602ac5e29 100644 --- a/src/Semantic/REPL.hs +++ b/src/Semantic/REPL.hs @@ -72,7 +72,17 @@ repl proxy parser lang paths = runTaskWithOptions debugOptions $ do (runReader (lowerBound @Span) (runReader (lowerBound @(ModuleTable (NonEmpty (Module (ModuleResult Precise))))) (raiseHandler (runModules (ModuleTable.modulePaths (packageModules package))) - (evaluate proxy id withTermSpans (Concrete.runFunction coerce coerce) modules))))))) + (evaluate proxy id (withTermSpans . step) (Concrete.runFunction coerce coerce) modules))))))) + +step :: Member REPL effects + => SubtermAlgebra (Base term) term (TermEvaluator term address value effects a) + -> SubtermAlgebra (Base term) term (TermEvaluator term address value effects a) +step recur term = do + str <- prompt + output str + res <- recur term + output "leaving term" + pure res newtype REPLEff address a = REPLEff