我试图理解为什么类型:
(flip .) is: (a -> a1 -> b -> c) -> a -> b -> a1 -> c
首先,类型:
flip: is (a -> b -> c) -> b -> a -> c
(.): is (b -> c) -> (a -> b) -> a -> c
我将重命名变量以在我的解释中更清楚,所以类型:
flip: is (ax -> bx -> cx) -> bx -> ax -> cx
(.): is (by -> cy) -> (ay -> by) -> ay -> cy
然后我尝试像这样替换:
ax = (by -> cy)
bx = (ay -> by)
cx = ay -> cy
所以得到的类型是:(ay -> by) (by -> cy) -> ay -> cy,与正确的结果不同。
有什么帮助吗?
谢谢,塞巴斯蒂安。