From 1cd7b5a25bacd56f4241bd7557926ec5a7ff02df Mon Sep 17 00:00:00 2001 From: crumbtoo Date: Fri, 24 Nov 2023 01:17:35 -0700 Subject: [PATCH] comment --- src/TIM.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/TIM.hs b/src/TIM.hs index 0d91182..47a92b5 100644 --- a/src/TIM.hs +++ b/src/TIM.hs @@ -462,6 +462,10 @@ dbgProg p = do hdbgProg :: Program -> Handle -> IO (Node, Stats) hdbgProg p hio = do + -- lazy IO causes a funny quirk here! before we had the `hPrintf` call + -- printing the final statistics, crashes would leave emit logs allowing us + -- to see the state of the machine before an error. the statistics however, + -- needs to be fully evaluated and before the logs are printed. a bit goofy. hPrintf hio "==== Stats ====\n\ \result : %s\n\ \allocations : %4d\n\