13 Nov 18:16
Re: Could someone teach me why we use Data.Monoid?
Rafael Gustavo da Cunha Pereira Pinto <RafaelGCPP.Linux <at> gmail.com>
2009-11-13 17:16:47 GMT
2009-11-13 17:16:47 GMT
"...in my humble opinion. (Which, obviously, nobody else will agree with.)"
I somewhat agree with your opinion!!
What I miss the most is practical examples:
1) A function that uses a Monoid as a container
2) A function that uses Monoid as algebra
and so on, for most of categories.
I had a hard time understanding monads, not because I didn't understand the concept of a monad, but because practical uses are missing, except on Wadler's paper!
Regards
Rafael
On Fri, Nov 13, 2009 at 14:52, Andrew Coppin <andrewcoppin <at> btinternet.com> wrote:
Stephen Tetley wrote:This is the thing. If we had a class specifically for containers, that could be useful. If we had a class specifically for algebras, that could be useful. But a class that represents "any possible thing that can technically be considered a monoid" seems so absurdly general as to be almost useless. If you don't know what an operator *does*, being able to abstract over it isn't especially helpful...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_.
...in my humble opinion. (Which, obviously, nobody else will agree with.)
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
--
Rafael Gustavo da Cunha Pereira Pinto
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe <at> haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RSS Feed