Joe Buehler wrote:
What is the point in building this huge thunk if it can't be evaluated without a stack overflow?
It's not that there's a point to it, it's just the behaviour of foldl. Hence you shouldn't be using foldl.
GHC's strictness analyser can sometimes save you from yourself if you're compiling with -O, but it's better to just avoid foldl and use foldr or Data.List.foldl' instead.
<b _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe