
4 Oct
2007
4 Oct
'07
7:57 a.m.
On 10/4/07, Dominic Steinitz
Look at the type of (.).(.).(.)
Indeed, this generalizes to functions of any arity on the "RHS": Prelude> :t (.) (.) :: (b -> c) -> (a -> b) -> a -> c Prelude> :t (.).(.) (.).(.) :: (b -> c) -> (a -> a1 -> b) -> a -> a1 -> c Prelude> :t (.).(.).(.) (.).(.).(.) :: (b -> c) -> (a -> a1 -> a2 -> b) -> a -> a1 -> a2 -> c Prelude> :t (.).(.).(.).(.) (.).(.).(.).(.) :: (b -> c) -> (a -> a1 -> a2 -> a3 -> b) -> a -> a1 -> a2 -> a3 -> c Of course, if you want higher-arity functions anywhere *other* than the head of your composition chain, you'll have to resort to tupling and uncurrying. Stuart