[Haskell-cafe] Re: Could someone teach me why we use Data.Monoid?
magicloud.magiclouds at gmail.com
Fri Nov 13 12:31:32 EST 2009
It is a great example, shows both howto and benefits. Thanks.
2009/11/14 Maurício CA <mauricio.antunes at gmail.com>:
>> I have looked the concept of monoid and something related, but
>> still, I do not know why we use it?
> I don't know if it's a good example, but it's simple. This
> package I wrote uses reverse polish notation to write gtk2hs
> layout windows.
> Since the type for operators used in the stack is a Monoid
> instance, you can combine many of them to create new operators.
> I believe you can think of monoids as things you can sequence
> to make new ones of the same type, but someone with better
> knowledge please say if this is actually a misleading idea.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe