Consider:
:type (flip .)
(flip .) :: (a -> a1 -> b -> c) -> a -> b -> a1 -> c
I just can't figure out why. As I understand, flip
has the following type:
flip :: (a -> b -> c) -> b -> a -> c
In addition (.)
has the following type:
(.) :: (b1 -> c1) -> (a1 -> b1) -> a1 -> c1
Hence, unifying the types I get:
a = (b1 -> c1) -> (a1 -> b1)
b = a1
Which gives:
(flip .) :: a1 -> ((b1 -> c1) -> (a1 -> b1)) -> c1
Which is far from the actual type.
What am I doing wrong? Any sort of help would be appreciated.