
20 Mar
2009
20 Mar
'09
8:40 a.m.
On Fri, Mar 20, 2009 at 11:59 AM, GüŸnther Schmidt
I apparently can have a huge thunk build up eventhough I use a supposedly accumulative, tail-recursive algorithm.
This is correct. If you don't strictly evaluate your accumulator before you tail recursive, a thunk will build up. See the tail recursive foldl for example in: http://haskell.org/haskellwiki/Foldr_Foldl_Foldl%27 This is why you probably always need the strict foldl' instead of foldl. regards, Bas