[Haskell-cafe] Re: Very crazy

Martin Lütke prionic at gmx.de
Tue Sep 25 09:18:24 EDT 2007


Dominic Steinitz schrieb:
> Andrew Coppin <andrewcoppin <at> btinternet.com> writes:
>
>   
>> I just found it rather surprising. Every time *I* try to compose with 
>> functions of more than 1 argument, the type checker complains. 
>> Specifically, suppose you have
>>
>>   foo = f3 . f2 . f1
>>
>> Assuming those are all 1-argument functions, it works great. But if f1 
>> is a *two* argument function (like map is), the type checker refuses to 
>> allow it, and I have to rewrite it as
>>
>>   foo x y = f3 $ f2 $ f1 x y
>>
>>     
> Look at the type of (.).(.) which should tell you how to compose functions 
> with more than one variable. Mind you, I don't think it improves readability.
>
> Dominic.
>   
Interesting function. It got a sibling: (.)(.) :: (a1 -> b -> c) -> a1 
-> (a -> b) -> a -> c

Anybody knows how to intepret that? I tried to call it with (++) "t" 
(++"s") "it" but suddenly got distracted.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070925/bbe68ac1/attachment.htm


More information about the Haskell-Cafe mailing list