From 8724df05fe58e6e55f81fc8ed9f10a573e86e2b0 Mon Sep 17 00:00:00 2001 From: crumbtoo Date: Fri, 24 Nov 2023 00:42:48 -0700 Subject: [PATCH] corrections --- src/Core/Examples.hs | 1 + src/TIM.hs | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Core/Examples.hs b/src/Core/Examples.hs index a99505a..153db5c 100644 --- a/src/Core/Examples.hs +++ b/src/Core/Examples.hs @@ -93,6 +93,7 @@ listExample1 = [coreProg| listExample2 = [coreProg| cc f x xs = Cons (f x) (map f xs) map f l = caseList# l Nil (cc f) + list = Cons 1 (Cons 2 (Cons 3 Nil)) main = map negate# list; |] diff --git a/src/TIM.hs b/src/TIM.hs index cfd591b..0d91182 100644 --- a/src/TIM.hs +++ b/src/TIM.hs @@ -462,15 +462,15 @@ dbgProg p = do hdbgProg :: Program -> Handle -> IO (Node, Stats) hdbgProg p hio = do - -- hPrintf hio "==== Stats ====\n\ - -- \result : %s\n\ - -- \allocations : %4d\n\ - -- \reductions : %4d\n\ - -- \dereferences : %4d\n\n" - -- (show res) - -- (sts ^. stsAllocations) - -- (sts ^. stsReductions) - -- (sts ^. stsDereferences) + hPrintf hio "==== Stats ====\n\ + \result : %s\n\ + \allocations : %4d\n\ + \reductions : %4d\n\ + \dereferences : %4d\n\n" + (show res) + (sts ^. stsAllocations) + (sts ^. stsReductions) + (sts ^. stsDereferences) (hPutStr hio . prettyShow) `traverse_` p' pure (res, sts) where