[Haskell-cafe] Formalisation for types of monads

Ertugrul Söylemez es at ertes.de
Wed May 23 09:24:06 CEST 2012

Yves Parès <yves.pares at gmail.com> wrote:

> >     Note about []:  Don't even mention foldl.  The folding
> > combinator for lists is foldr, period.
> Yes, I do agree. I came to this when I realized foldr gave the church
> encoding of a list.

Not only that.  The foldr combinator has an identity fold and implements
actual structural recursion.  The point is to give an idea what
structural recursion means.  I usually also introduce a custom tree
type, again with a folding combinator.

> (Well, actually, due to parameters ordering:
>     *churchList list* z0 f = foldr f z0 list
> does)

Yes, the argument ordering of our foldr is a bit unfortunate.


Key-ID: E5DD8D11 "Ertugrul Soeylemez <es at ertes.de>"
FPrint: BD28 3E3F BE63 BADD 4157  9134 D56A 37FA E5DD 8D11
Keysrv: hkp://subkeys.pgp.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120523/3216dd93/attachment.pgp>

More information about the Haskell-Cafe mailing list