[Haskell-cafe] Debunking tail recursion

Joe Thornber joe.thornber at gmail.com
Fri May 18 06:00:13 EDT 2007


This page [1] has useful info on it.  Having done a lot of lisp/ocaml
before coming to Haskell I was also very attached to tail recursion;
it took a long time to realise this was wrong.  This topic definitely
needs more prominence on the wiki.

- Joe

[1] http://www.haskell.org/haskellwiki/Stack_overflow


On 18/05/07, Jules Bean <jules at jellybean.co.uk> wrote:
> A conversation on #haskell just showed that it's quite hard to explain
> (at least it is for me) to people attached to tail recursion why that is
> a red herring in Haskell.
>
> I had a poke around the wiki and couldn't see a page which explains it
> clearly. In fact
> http://www.haskell.org/haskellwiki/Performance/Accumulating_parameter is
> actuall slightly misleading since it suggests that the performance gain
> is from the tail recursion whereas really it's from the change from a
> function which accumulates an enormous thunk to an function which can do
> the work as it goes along.
>
> If someone has the energy and the clarity to explain this clearly and
> make a wiki page about it, that would be great. If someone finds an
> existing wiki page I'm too unperceptive to notice, even better!
>
> Jules
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list