[Haskell-cafe] Formalisation for types of monads
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
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
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: not available
More information about the Haskell-Cafe