[Haskell-cafe] Re: Could someone teach me why we use Data.Monoid?
Maurício CA
mauricio.antunes at gmail.com
Fri Nov 13 12:15:40 EST 2009
> 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.
http://hackage.haskell.org/package/gtk2hs-rpn
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.
Best,
Maurício
More information about the Haskell-Cafe
mailing list