Preventing/handling space leaks

ajb at spamcop.net ajb at spamcop.net
Wed Dec 10 16:46:43 EST 2003


G'day all.

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

> 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: http://users.aber.ac.uk/afc/stricthaskell.html

Cheers,
Andrew Bromage


More information about the Haskell-Cafe mailing list