Preventing/handling space leaks

ajb at ajb at
Wed Dec 10 16:46:43 EST 2003

G'day all.

Quoting Henk-Jan van Tuyl <Henk-Jan.van.Tuyl at>:

> So far I have seen only one rule for Good Coding Practice in Haskell: Do Not
> Use n+k Patterns. I hope someone can give some directions, how to avoid known
> pitfalls (especially Space Leaks).

Here are a few rules of thumb:

        - Know what data is "transient" and what data is "persistent".
        - Persistent data should be fully evaluated where possible.
        - Transient data should not have multiple consumers if possible.
        - Use large CAFs sparingly.

Also good:

Andrew Bromage

More information about the Haskell-Cafe mailing list