
25 Sep
2007
25 Sep
'07
11:33 a.m.
Andrew Coppin
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.