I got it. Thanks a lot. By the way, can you provide with example of using resultFun or secondFun.<br>I did search on Hyahoo and Hoogle for names and signatures and I didn&#39;t see any.<br><br>Thanks,<br><br>Malik<br><br><div class="gmail_quote">
On Thu, Nov 18, 2010 at 1:29 PM, Daniel Fischer <span dir="ltr">&lt;<a href="mailto:daniel.is.fischer@web.de">daniel.is.fischer@web.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Thursday 18 November 2010 18:51:32, MH wrote:<br>
&gt; Oh, so this signature is really a partial application that expects<br>
&gt; another parameter to be executed.<br>
<br>
</div>Depends on how you look at it.<br>
Strictly speaking, there is no such thing as partial application. Every<br>
function takes exactly one argument, so it&#39;s either not applied to any<br>
argument at all yet or it&#39;s fully applied. But the result of a function<br>
application can be another function, so it may take another argument ...<br>
<br>
However, always talking about functions taking an argument of type a and<br>
returning a function taking an argument of type b and returning a function<br>
taking an argument of type c ...<br>
is terribly cumbersome, so we speak of functions taking several arguments.<br>
<br>
But note that the number of arguments a function takes until the final<br>
result is no longer a function is not always fixed. For example,<br>
id :: a -&gt; a takes one argument, obviously, doesn&#39;t it?<br>
But if that argument is a function, it takes one more argument, so id can<br>
take two arguments, or three, or however many you want, it depends on which<br>
arguments you pass.<br>
<br>
So when you have a value of type a -&gt; b -&gt; c (which is the same as<br>
a -&gt; (b -&gt; c), since the function arrow is right-associative), and apply it<br>
to a value of type a, sometimes it is more appropriate to think of that as<br>
a partial application, sometimes as a complete application resulting in a<br>
function.<br>
<div class="im"><br>
&gt; So<br>
&gt; resultFun   :: (h b -&gt; h b&#39;) -&gt; (h (a-&gt;b) -&gt; h (a-&gt;b&#39;))<br>
<br>
</div>which is<br>
<div class="im"><br>
resultFun :: (h b -&gt; h b&#39;) -&gt; h (a -&gt; b) -&gt; h (a -&gt; b&#39;)<br>
<br>
&gt; is<br>
&gt; foo :: h b -&gt; h b&#39;<br>
<br>
</div>Yes<br>
<div class="im"><br>
&gt; bar :: h (a-&gt;b) -&gt; h (a-&gt;b&#39;)<br>
<br>
</div>No. bar :: h (a -&gt; b)<br>
<br>
resultFun foo :: h (a -&gt; b) -&gt; h (a -&gt; b&#39;)<br>
<br>
so it takes an argument of type h (a -&gt; b) and its result has type<br>
h (a -&gt; b&#39;)<br>
(which may be another function type, if h x = e -&gt; x).<br>
<div class="im"><br>
&gt;<br>
&gt; firstFunction = resultFun foo<br>
&gt; result = firstFunction bar<br>
<br>
</div>Yep<br>
<br>
&gt;<br>
&gt; Is this correct?<br>
</blockquote></div><br>