
12 Jun
2004
12 Jun
'04
1:54 p.m.
Hi all, My intuition tells me that the code in http://urchin.earth.li/~ian/Mem.hs should have the same space usage regardless of whether USESMEM is defined. However, when compiling with ghc -Wall -O2 -cpp --make Mem -o mem and running ./mem True 100000 > /dev/null it runs in constant space but compiling with ghc -Wall -O2 -cpp -DUSESMEM --make Mem -o mem and running in the same way it increases up to >100M. Is this an instance of GHC not being as smart as it could? Or is it a case in which I need to give it additional strictness annotations in order to get it to run in constant space (and if so, what annotations would be best?)? Thanks Ian