Jeff,<div><br></div><div>I don&#39;t think your code works in general, since it is not guaranteed that x&#39; == mzero is allowed unless (m b) is an instance of Eq. I&#39;m unsure if you are able to test for mzero in general.</div>

<div><br></div><div>Harry<br><br><div class="gmail_quote">On Mon, Mar 26, 2012 at 3:11 PM, Jeff Shaw <span dir="ltr">&lt;<a href="mailto:shawjef3@msu.edu">shawjef3@msu.edu</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"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
can :: (MonadPlus m) =&gt; (a -&gt; m b) -&gt; a -&gt; Bool<br>
can f x = case f x of<br>
            mzero -&gt; False<br>
            _ -&gt; True<br>
<br>
<br>
I got a warning:<br>
<br>
__testError.hs:31:11:<br>
    Warning: Pattern match(es) are overlapped<br>
             In a case alternative: _ -&gt; ...<br>
Ok, modules loaded: Main.<br>
</blockquote></div>
The problem here is that when you match on &quot;f x&quot;, your first match is an identifier that matches anything at all, and binds it to mzero. I think what you&#39;re looking for is<div class="im"><br>
<br>
can f x = case f x of<br></div>
    x&#39; | x&#39; == mzero -&gt; False<br>
    _ -&gt; True<br>
<br>
Jeff<br>
<br>
______________________________<u></u>_________________<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/<u></u>mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br></div>