<br><div class="gmail_quote">2011/3/22 Mario Blažević <span dir="ltr">&lt;<a href="mailto:mblazevic@stilo.com">mblazevic@stilo.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><br>
</div>
<div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">This seems very interesting. One question:<br>
<br>
&gt; The MonadPlus and the Alternative instance differ: the former&#39;s mplus<br>
&gt; combinator equals the asymmetric &lt;&lt;|&gt; choice.<br>
<br>
Why?<br>
</blockquote></div><div><br><br>    Good question. Basically, I see MonadPlus as a union of Monad and Alternative. The class should not exist at all. But as long as it does, I figured I should provide an instance, and I made it different from the Monoid+Alternative combination because otherwise it would be useless. My second choice would be to remove the instance completely.<br>
</div></div></blockquote><div><br></div>I have to admit I really do not like having Applicative and MonadPlus with different behavior. Yes, one is redundant, but that is more an artifact of language evolution, than an intentional opportunity for diverging behavior.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Every library I am aware of to date, save of course this one, has maintained their compatibility.</div><div class="gmail_quote"><br></div><div class="gmail_quote">
If the instance for Alternative satisfies the underspecified MonadPlus laws, I&#39;d just as soon have the &#39;useless redundant&#39; instance. The power of MonadPlus is in the combinators that are built on top of it. Not in the primitives themselves.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">If the Alternative instance would not be a legal MonadPlus instance, then I&#39;d feel much less queasy with your second scenario, and it simply removed. </div><div class="gmail_quote">
<br></div><div class="gmail_quote">-Edward</div>