From 4c6386fd250e8447e76ec9dfb6e8f5a266a050e2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 29 Feb 2024 11:35:25 +0100 Subject: Added higher order reducer --- src/Eval.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Eval.hs') diff --git a/src/Eval.hs b/src/Eval.hs index 2e9746d..5091b49 100644 --- a/src/Eval.hs +++ b/src/Eval.hs @@ -7,6 +7,7 @@ import Binary import Control.Concurrent import Control.DeepSeq ( deepseq ) import Control.Exception +import Control.Monad ( when ) import Control.Monad.State import qualified Control.Monad.State.Strict as StrictState import qualified Data.BitString as Bit @@ -148,7 +149,7 @@ evalQuote f sub = evalExp f sub >>= \case evalUnquote :: Expression -> Environment -> EvalState (Failable Expression) evalUnquote f sub = evalExp f sub >>= \case Left e -> pure $ Left e - Right f' -> pure $ Right $ Unquote $ unsafeReduce f' -- TODO: REMOVE UNSAFE + Right f' -> pure $ Right $ Unquote $ reduceNoIO f' evalExp :: Expression -> Environment -> EvalState (Failable Expression) evalExp idx@(Bruijn _ ) = const $ pure $ Right idx -- cgit v1.2.3