<br><br><div class="gmail_quote">On Fri, Nov 13, 2009 at 8:52 AM, Andrew Coppin <span dir="ltr">&lt;<a href="mailto:andrewcoppin@btinternet.com">andrewcoppin@btinternet.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Stephen Tetley wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2009/11/13 Rafael Gustavo da Cunha Pereira Pinto &lt;<a href="mailto:RafaelGCPP.Linux@gmail.com" target="_blank">RafaelGCPP.Linux@gmail.com</a>&gt;:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Monoid is the category of all types that have a empty value and an append<br>
operation.<br>
<br>
<br>
</blockquote>
<br>
Or more generally a neutral element and an associative operation:<br>
<br>
The multiplication monoid (1,*)<br>
<br>
9*1*1*1 = 9<br>
<br>
1 is neutral but you might be hard pressed to consider it _empty_.<br>
<br>
</blockquote>
<br></div>
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 &quot;any possible thing that can technically be considered a monoid&quot; seems so absurdly general as to be almost useless. If you don&#39;t know what an operator *does*, being able to abstract over it isn&#39;t especially helpful...<br>

<br>
...in my humble opinion. (Which, obviously, nobody else will agree with.)</blockquote><div><br></div><div><br></div><div>Well to your credit, many people wonder what it means for something to implement the Monoid interface, or even why the Monoid interface is useful. Programmers who don&#39;t know what Monoids are may not be aware of the varying alternatives of Monoid implementations. They&#39;re curious things to have, but are they useful? :-)</div>
<div><br></div><div>Sum vs Product spells out two ways to use Ints in a Monoid context. But we could have done the same with the Functor implementation for lists via fmap now couldn&#39;t we? Is anyone really using Sum and Product where Functors get the job done? </div>
<div><br></div><div>Practically speaking, I can explain to coworkers the concept of a Functor a lot easier than Monoids so I don&#39;t choose to use Monoids explicitly in my code.</div><div><br></div><div>I do use MonadPlus though, especially with Maybe as it makes a nice short-circuit syntax around alternatives for potential Nothing results. So in a way I&#39;m possibly shooting myself in the foot if I have to explain the code to someone who was expecting a case or an if expression.</div>
<div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>