
28 Apr
2003
28 Apr
'03
8:07 a.m.
Nick Name
You are right, [...]
I further conjecture that more than half of all space leaks can be identified not by profiling your code but by running the following command:
grep '+1' *.hs *.lhs
I'm half joking but I've found that this one is very common in certain kinds of code.
Good idea! Here's another space-leak-avoiding trick: whenever you write Int as a constructor field, consider writing !Int instead. Same goes for other basic types and tuples. This pre-emptive space leak avoidance helps us in GHC quite a bit. Cheers, Simon