Ticket #2622 (closed bug: invalid)
sum and product thunkpile
Do "ulimit -v 524288" at the shell so your machine won't hang. Run ghci, bring in Data.List, and execute "sum [1..10**8]". Notice that you run out of memory. Now try again with "foldl1' (+) [1..10**8]". Note that you get an answer.
The definition of sum and product in the Report use foldl. However, the versions currently being used are open-coded for some reason. They should just use foldl1' (after handling the special case of the empty list appropriately). As it is, the functions thunkpile; this seems pointless, as they are ultimately completely strict in their argument.
This kind of bug is grim for new users, which is why the severity is marked "major".
Patch attached. This is just a context unidiff against current Darcs head; a Darcs-format patch with full context (at 350KB) is at http://po8.org/bart/sumprod.patch