[Haskell-cafe] Could someone teach me why we use Data.Monoid?

Magicloud Magiclouds magicloud.magiclouds at gmail.com
Fri Nov 13 12:11:27 EST 2009


That is OK. Since understand the basic concept of monoid (I mean the
thing in actual math), the idea here is totally not hard for me. But
the sample here does not show why (or how) we use it in programming,
right?

On Sat, Nov 14, 2009 at 12:48 AM, Stephen Tetley
<stephen.tetley at gmail.com> wrote:
> 2009/11/13 Rafael Gustavo da Cunha Pereira Pinto <RafaelGCPP.Linux at gmail.com>:
>>
>> Monoid is the category of all types that have a empty value and an append
>> operation.
>>
>
> Or more generally a neutral element and an associative operation:
>
> The multiplication monoid (1,*)
>
> 9*1*1*1 = 9
>
> 1 is neutral but you might be hard pressed to consider it _empty_.
>
>
> Best wishes
>
> Stephen
> _______________________________________________
> 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