I'm trying to understand why the type of:
(flip .) is: (a -> a1 -> b -> c) -> a -> b -> a1 -> c
First of all, the type of:
flip: is (a -> b -> c) -> b -> a -> c
(.): is (b -> c) -> (a -> b) -> a -> c
I will rename the variables to be more clear in my explanation, so the types:
flip: is (ax -> bx -> cx) -> bx -> ax -> cx
(.): is (by -> cy) -> (ay -> by) -> ay -> cy
Then I try substituing like this:
ax = (by -> cy)
bx = (ay -> by)
cx = ay -> cy
So the resulting type is: (ay -> by) (by -> cy) -> ay -> cy, which is different with the correct result.
Any help?
Thanks, Sebastián.