<br><div><span class="gmail_quote">On 7/25/07, <b class="gmail_sendername">Alexteslin</b> &lt;<a href="mailto:alexteslin@yahoo.co.uk">alexteslin@yahoo.co.uk</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hi,<br><br>I am going through examples from the textbook and trying them out but some<br>don&#39;t work.<br>For example:<br><br>addNum :: Int -&gt; (Int -&gt; Int)<br>addNum n = addN<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;addN m = n+m
<br><br>This error message i am getting:<br><br>ERROR - Cannot find &quot;show&quot; function for:<br>*** Expression : addNum 4<br>*** Of type&nbsp;&nbsp;&nbsp;&nbsp;: Int -&gt; Int</blockquote><div><br>Hi,<br><br>Printing functions is in general not possible, since given a function f there is no way to &quot;get at&quot; its implementation.*&nbsp; Functions are like black boxes.&nbsp; The only way to observe a function is to observe its effect on various inputs.&nbsp; So you can try (addNum 4) 6,&nbsp; (addNum 4) 0, and so on to see what the function (addNum 4) does to various Int values. 
<br><br>cheers,<br>-Brent<br><br>*(If there were it would lead to all sorts of fun non-referential-transparency...)&nbsp; <br></div><br></div>