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.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe