<br><div><span class="gmail_quote">On 7/25/07, <b class="gmail_sendername">Alexteslin</b> <<a href="mailto:alexteslin@yahoo.co.uk">alexteslin@yahoo.co.uk</a>> 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't work.<br>For example:<br><br>addNum :: Int -> (Int -> Int)<br>addNum n = addN<br> where<br> addN m = n+m
<br><br>This error message i am getting:<br><br>ERROR - Cannot find "show" function for:<br>*** Expression : addNum 4<br>*** Of type : Int -> Int</blockquote><div><br>Hi,<br><br>Printing functions is in general not possible, since given a function f there is no way to "get at" its implementation.* Functions are like black boxes. The only way to observe a function is to observe its effect on various inputs. So you can try (addNum 4) 6, (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...) <br></div><br></div>