> > Subject: [Haskell-cafe] A clarification about what happens under the
> > hoodwith foldMap
> >
> > I'm sure I'm missing a point, but the "minimum" definition for a Foldable
> > instance is given in terms of foldMap, so I get the ca
> From: Alfredo Di Napoli
> Subject: [Haskell-cafe] A clarification about what happens under the
> hoodwith foldMap
>
> I'm sure I'm missing a point, but the "minimum" definition for a Foldable
> instance is given in terms of foldMap, so I g
Thanks guys,
I'll work my way through Oleg's paradox as well as what you just said
Chaddai.
I'm very busy right now, but I'll probably come back to you tomorrow
morning, when I'll have an hour to think freely :)
Cheers,
A.
___
Haskell-Cafe mailing list
H
On Tue, Oct 23, 2012 at 10:36 AM, Alfredo Di Napoli
wrote:
> I'm sure I'm missing a point, but the "minimum" definition for a Foldable
> instance is given in terms of foldMap, so I get the cake for free, foldr
> included, right?
> In the example I have defined my treeSum as:
>
> treeSum = Data.Fol
> I was playing with the classic example of a Foldable structure: Trees.
> So the code you can find both on Haskell Wiki and LYAH is the following:
>
> data Tree a = Empty | Node (Tree a) a (Tree a) deriving (Show, Eq)
>
> instance Foldable Tree where
> foldMap f Empty = mempty
> foldMap f
-- Forwarded message --
From: Alfredo Di Napoli
Date: 23 October 2012 10:35
Subject: Re: [Haskell-cafe] A clarification about what happens under the
hood with foldMap
To: Chaddaï Fouché
I'm sure I'm missing a point, but the "minimum" definition for a Foldab
Le 23 oct. 2012 09:54, "Alfredo Di Napoli" a
écrit :
>
> What this code does is straighforward. I was struck from the following
sentences in LYAH:
>
>> Notice that we didn't have to provide the function that takes a value
and returns a monoid value.
>> We receive that function as a parameter to fo
Hi Cafe,
I was playing with the classic example of a Foldable structure: Trees.
So the code you can find both on Haskell Wiki and LYAH is the following:
data Tree a = Empty | Node (Tree a) a (Tree a) deriving (Show, Eq)
instance Foldable Tree where
foldMap f Empty = mempty
foldMap f (Nod