Sorry .. my example was bad.&nbsp; I want to use &quot;x&quot; .. in&nbsp; then&nbsp; branch where it occur ...<br><br>e.g.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bonzo :: Maybe Bozo -&gt; IO ()<br>&nbsp; &nbsp; &nbsp; bonzo&nbsp; maybe_bozo = do<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case maybe_bozo of<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Just (Bozo x) -&gt; x ........<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; -&gt; .........<br><br>??<br><br>Thanks, V. &nbsp;&nbsp;  <br>&nbsp;<br><br><div class="gmail_quote">On Thu, May 1, 2008 at 7:50 PM, Luke Palmer &lt;<a href="mailto:lrpalmer@gmail.com">lrpalmer@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2008/5/2 Galchin, Vasili &lt;<a href="mailto:vigalchin@gmail.com">vigalchin@gmail.com</a>&gt;:<br>

<div class="Ih2E3d">&gt;<br>
&gt; data Bozo =<br>
&gt; &nbsp; &nbsp; Bozo {<br>
&gt; &nbsp; &nbsp; &nbsp; id :: Int<br>
&gt; &nbsp; &nbsp; }<br>
&gt;<br>
&gt; bonzo :: Maybe Bozo -&gt; IO ()<br>
&gt; bonzo &nbsp; maybe_bozo = do<br>
&gt; &nbsp; &nbsp;if maybe_bozo == (Just (Bozo &nbsp;x))<br>
&gt; &nbsp; &nbsp; &nbsp; then<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return ()<br>
&gt; &nbsp; &nbsp; &nbsp; else<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return ()<br>
<br>
</div>bonzo maybe_bozo =<br>
 &nbsp; &nbsp;case maybe_bozo of<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Just (Bozo x) -&gt; return ()<br>
 &nbsp; &nbsp; &nbsp; &nbsp;_ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -&gt; return ()<br>
<br>
Or equivalently:<br>
<div class="Ih2E3d"><br>
bonzo (Just (Bozo x)) = return ()<br>
</div>bonzo _ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = return ()<br>
<br>
You should watch out for your use of id as a field name, since id is a<br>
builtin function and you will get ambiguity errors.<br>
<font color="#888888"><br>
Luke<br>
</font></blockquote></div><br>