On Mon, Dec 08, 2003 at 02:24:51PM -0000, Simon Marlow wrote: > > Just compiling the code (instead of running it in GHCi) is enough to > prevent CAFs from leaking.
Ah, I see the story is a bit different that I thought. Please correct me I am wrong: When I compiled the code with -O2 there was no leak because t was optimised into a tight loop with no allocs. In other words: the CAF was not garbage-collected, but there was not much to collect. We see two things interacting here: 1. GHCi not reclaiming CAFs 2. Deforestation (and probably some other optimisations) This interaction made me believe that CAF leaks were eliminated by some optimisation turned on by -O2. But then... what trick does GHC use to prevent CAF leaks? Best regards, Tomek -- .signature: Too many levels of symbolic links _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell