[Haskell-cafe] Stack Overflow, tail recursion and CPS

Neil Mitchell ndmitchell at gmail.com
Wed Jan 14 12:32:18 EST 2009


Hi

> I have changed the insertion algo to use foldl to make it tail-recursive but
> still get a stack overflow as the "insert" remains lazy.

Try foldl' and insertWith' - that should work.

Thanks

Neil


More information about the Haskell-Cafe mailing list