Which is the type of (flip .)?

后端 未结 1 1532
你的背包
你的背包 2021-01-28 12:41

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:

相关标签:
1条回答
  • 2021-01-28 13:03

    (flip .) is (.) flip, so:

    • (.) :: (bx -> cx) -> (ax -> bx) -> ax -> cx
    • flip :: (ay -> by -> cy) -> by -> ay -> cy
    • In (.) flip,
      • bx is ay -> by -> cy
      • cx is by -> ay -> cy
      • so it’s all (ax -> (ay -> by -> cy)) -> ax -> (by -> ay -> cy),
        which is just (ax -> ay -> by -> cy) -> ax -> by -> ay -> cy,
        which matches up with (flip .) :: (a -> a1 -> b -> c) -> a -> b -> a1 -> c.
    0 讨论(0)
提交回复
热议问题