[Haskell-cafe] Re: Diagnosing stack overflow
Bryan O'Sullivan
bos at serpentine.com
Fri Aug 17 18:42:56 EDT 2007
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
More information about the Haskell-Cafe
mailing list