我正在尝试手动导出类型fun xss = \f -> let ope x y = x . f . y in foldr1 ope xss
F 。是的
y :: t1 -- First occurrence
f :: t2 -- First occurrence
(.) (b1 -> c1) -> (a1 -> b1) -> a1 -> c1 -- (.) definition
t1 ~ a1 -> b1 -- y unified with (a1 -> b1)
t2 ~ b1 -> c1 -- y unified with (b1 -> c1)
y :: a1 -> b1
f :: b1 -> c1
---
f . y :: a1 -> c1 -- Cancellation rule
\f -> 让操作 xy = x 。F 。是的
(.) (b2 -> c2) -> (a2 -> b2) -> a2 -> c2 -- (.) definition
x :: t3 -- First occurrence
t3 ~ b2 -> c2 -- x unified with (b2 -> c2)
a1 -> c1 ~ a2 -> b2 -- f . y unified with (a2 -> b2)
a1 ~ a2
c1 ~ b2
y :: a2 -> b1 -- Substituing a1 by a2
f :: b1 -> b2 -- Substituing c1 by b2
x :: b2 -> c2 -- Substituing t3 by b2 -> c2
---
x . f . y :: a2 -> c2 -- Cancellation rule
(\f -> let ope x y :: x . f . y)
:: (b2 -> c2) -> (a2 -> b1) -> (b1 -> b2) -> a2 -> c2 -- Adding f
foldr1 操作 xss
foldr1 :: (a -> a -> a) -> [a] -> a -- foldr1 definition
xss ~ t4 -- First occurrence
那么a ~ (b2 -> c2), a ~ (a2 -> b1), a ~ (b1 -> b2) and t4 ~ [a]
这似乎是一个错误。
有什么帮助吗?
谢谢,
塞巴斯蒂安。