<br><br><div class="gmail_quote">On 26 March 2012 21:11, 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></blockquote></div><br><span style="font-family:courier new,monospace">can f x = f x /= mzero</span><br>