
17 Aug
2007
17 Aug
'07
6:42 p.m.
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.