From 29c5bc9224de0c9a6acef3ed31e52fc91622b214 Mon Sep 17 00:00:00 2001 From: Rob Dockins Date: Tue, 13 Apr 2021 15:35:57 -0700 Subject: [PATCH] Fixes that help a small amount with space leaks --- src/Cryptol/Backend/Monad.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Cryptol/Backend/Monad.hs b/src/Cryptol/Backend/Monad.hs index f55b0473..6665aaf4 100644 --- a/src/Cryptol/Backend/Monad.hs +++ b/src/Cryptol/Backend/Monad.hs @@ -328,13 +328,15 @@ modifyCallStack f m = Eval $ \stk -> do let stk' = f stk -- putStrLn $ unwords ["Pushing call stack", show (displayCallStack stk')] - runEval stk' m + seq stk' (runEval stk' m) +{-# INLINE modifyCallStack #-} -- | Execute the given evaluation action. runEval :: CallStack -> Eval a -> IO a runEval _ (Ready a) = return a runEval stk (Eval x) = x stk runEval _ (Thunk tv) = unDelay tv +{-# INLINE runEval #-} {-# INLINE evalBind #-} evalBind :: Eval a -> (a -> Eval b) -> Eval b