[Haskell-beginners] Re: proper way to read fold types

prad prad at towardsfreedom.com
Sun Jul 25 01:31:50 EDT 2010


On Sun, 25 Jul 2010 00:15:24 +0200
Daniel Fischer <daniel.is.fischer at web.de> wrote:

> Maybe this helps:
> 
> foldr op z [x1, x2, x3] = x1 `op` (x2 `op` (x3 `op` z))
> 
> foldr1 op [x1, x2, x3] = x1 `op` (x2 `op` x3)
>
thx daniel.
the above seems to be the idea of replacing (:) with the function as
illustrated in the Another approach on the wiki:
http://www.haskell.org/haskellwiki/Fold

possibly, i'm making too big a deal trying to say it all in words. i
understand what it is doing and how to use it (for the most part) as
well as the 'Another approach' illustration. possibly i should just
stick to that.

-- 
In friendship,
prad

                                      ... with you on your journey
Towards Freedom
http://www.towardsfreedom.com (website)
Information, Inspiration, Imagination - truly a site for soaring I's


More information about the Beginners mailing list