Oh, so this signature is really a partial application that expects another parameter to be executed.<br>So<br>
resultFun :: (h b -> h b') -> (h (a->b) -> h
(a->b'))<br>is<br>foo :: h b -> h b'<br>bar :: h (a->b) -> h
(a->b')<br><br>firstFunction = resultFun foo<br>result = firstFunction bar<br><br>Is this correct?<br><br><div class="gmail_quote">On Thu, Nov 18, 2010 at 10:52 AM, Daniel Fischer <span dir="ltr"><<a href="mailto:daniel.is.fischer@web.de">daniel.is.fischer@web.de</a>></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><div></div><div class="h5">On Thursday 18 November 2010 16:07:34, MH wrote:<br>
> I am looking at signatures for Arrow and Composable classes and I cannot<br>
> understand some of them. Could you please explain me the following:<br>
> Let's take for example the following:<br>
><br>
> class FunAble h => FunDble h where<br>
> resultFun :: (h b -> h b') -> (h (a->b) -> h (a->b'))<br>
><br>
> class FunAble h where<br>
> secondFun :: (h b -> h b') -> (h (a,b) -> h (a,b')) -- for 'second'<br>
><br>
><br>
> in the signatures:<br>
> resultFun :: (h b -> h b') -> (h (a->b) -> h (a->b'))<br>
> secondFun :: (h b -> h b') -> (h (a,b) -> h (a,b'))<br>
><br>
> if (h b -> h b') is the input of these functions where does 'a' comes<br>
> from in the output?<br>
<br>
</div></div>'a' is arbitrary, so it works for all 'a'. The result of resultFun foo,<br>
resp. secondFun foo is a function of type<br>
<div class="im"><br>
h (a -> b) -> h (a -> b')<br>
<br>
</div>resp.<br>
<div class="im"><br>
h (a,b) -> h (a,b')<br>
<br>
</div>where the types b and b' have been determined by foo (not necessarily<br>
completely, if foo is id, all that has been determined is that b' = b) and<br>
'a' is still arbitrary. The type variable 'a' is fixed or restricted when<br>
xxxFun gets its second argument, bar in<br>
<br>
resultFun foo bar<br>
<br>
resp.<br>
<br>
secondFun foo bar.<br>
<br>
><br>
> Thanks,<br>
<br>
HTH,<br>
<font color="#888888">Daniel<br>
<br>
</font></blockquote></div><br>