我试图推导出的类型zipWith . uncurry
zipWith . uncurry = (.) zipWith uncurry
-- 串联作为函数
(.) :: (b1 -> c1) -> (a1 -> b1) -> a1 -> c1
zipWith :: (a2 -> b2 -> c2) -> [a2] -> [b2] -> [c2]
uncurry :: (a3 -> b3 -> c3) -> (a3, b3) -> c3
b1 ~ (a2 -> b2 -> c2)
c1 ~ [a2] -> [b2] -> [c2]
a1 ~ (a3 -> b3 -> c3)
b1 ~ (a3, b3) -> c3
a1
用(a3 -> b3 -> c3)
和替换我得到c1
:[a2] -> [b2] -> [c2]
(.) zipWith uncurry :: a1 -> c1 ~ (a3 -> b3 -> c3) -> [a2] -> [b2] -> [c2]
如果我查询 GHCi:t zipWith . uncurry
我得到:(a -> b1 -> b -> c) -> [(a, b1)] -> [b] -> [c]
我认为关键在于,b1 ~ (a2 -> b2 -> c2) ~ (a3, b3) -> c3
但我不知道如何将我的结果与预期相匹配。
有什么帮助吗?
谢谢,
塞巴斯蒂安。