[Haskell-cafe] Definition of "tail recursive" wrt Folds

Tammo Spalink (司馬泰) tammo at google.com
Wed Mar 25 03:48:46 EDT 2009


wikipedia is your friend...

http://en.wikipedia.org/wiki/Fold_(higher-order_function)

Tammo

2009/3/25 Mark Spezzano <mark.spezzano at chariot.net.au>:
> Hi,
>
>
>
> Just looking at the definitions for foldr and foldl I see that foldl is
> (apparently) tail recursive while foldr is not.
>
>
>
> Why?
>
>
>
> Is it because foldl defers calling itself until last whereas foldr evaluates
> itself as it runs?
>
>
>
> What, strictly speaking, is the definition of ”tail recursive” as opposed to
> just “recursive”?
>
>
>
> Cheers,
>
>
>
> Mark Spezzano
>
>
>
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.557 / Virus Database: 270.11.27/2021 - Release Date: 24/03/2009
> 4:00 PM
>
> _______________________________________________
> 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