<div dir="ltr">My intention wasn't to add these laws, but to replace the existing MonadPlus ones. (Adding new laws wouldn't help with the original ones being invalid.) But you're right, the laws I proposed follow from Monad laws and from<div>

<br></div><div>    mzero >>= f  =  mzero</div><div><br></div><div>This single law is enough to ensure that any chain of operations containing `mzero` "ends" at this point.</div><div><br></div><div>So the best solution seems to just remove the problematic</div>

<div><br></div><div>    v >> mzero   =  mzero<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-04 Dan Burton <span dir="ltr"><<a href="mailto:danburton.email@gmail.com" target="_blank">danburton.email@gmail.com</a>></span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<span style="font-family:arial,sans-serif;font-size:13.333333969116211px">I'm not sure what should be the proper solution. Perhaps to change the laws to:</span><br style="font-family:arial,sans-serif;font-size:13.333333969116211px">



<span style="font-family:arial,sans-serif;font-size:13.333333969116211px">  return x >> mzero  =  mzero<br></span><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">  (v >> mzero) >>= f  =  (v >> mzero)`</span><br style="font-family:arial,sans-serif;font-size:13.333333969116211px">



<span style="font-family:arial,sans-serif;font-size:13.333333969116211px">That is, if an expression ends with `mzero`, it behaves like `mzero`.</span></blockquote><div class="gmail_extra"><br></div></div><div class="gmail_extra">



These laws are redundant with existing laws. The first:</div><div class="gmail_extra"><br></div><div class="gmail_extra">    return x >> z = z</div><div class="gmail_extra"><br></div><div class="gmail_extra">Is true forall x and z, and can be proven by just the monad laws. The second:</div>

<div class="im">

<div class="gmail_extra"><br></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">    (v >> mzero) >>= f  =  (v >> mzero)</span><br></div><div class="gmail_extra">



<br></div></div><div class="gmail_extra">Can be proven by the associativity of monadic operations:</div><div class="gmail_extra"><br></div><div class="gmail_extra">    (v >> mzero) >>= f  =  v >> (mzero >>= f)</div>



<div class="gmail_extra"><br></div><div class="gmail_extra">And the other MonadPlus law already states that (mzero >>= f) = mzero. So I don't think any new laws are needed. I just think the (v >> mzero = mzero) law should be removed, or else a *lot* of instances of MonadPlus need to come with a disclaimer that they are not law-abiding.</div>

<span class="HOEnZb"><font color="#888888">

<div class="gmail_extra"><br clear="all"><div>-- Dan Burton</div></div></font></span></div>
</blockquote></div><br></div>