On Fri, Mar 20, 2009 at 11:59 AM, GüŸnther Schmidt <gue.schm...@web.de> wrote:
> 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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to