[Haskell-cafe] Re: (state) monad and CPS

Heinrich Apfelmus apfelmus at quantentunnel.de
Thu Nov 12 05:04:40 EST 2009


jean-christophe mincke wrote:
> I do not master all the subtilities of lazy evaluation yet and perhaps  tail
> recursivity does not have the same importance (or does not offer the same
> guarantees) in a lazy language as it does in a strict language.

Yep, that's the case. With lazy evaluation, tail recursion is less
important. Also, code that looks tail recursive in a strict language
will actually not be tail recursive in Haskell. A well-known example is
the definition  foldl  and applied in the fashion of

    foldl (+) 0 [0..10]


Regards,
apfelmus

--
http://apfelmus.nfshost.com



More information about the Haskell-Cafe mailing list