SI-2712 Add support for partial unification of type constructors #5102最初提供了标记下的功能
-Yhigher-order-unification
但随后将其重命名为
-Ypartial-unification
因为它似乎不是完全高阶统一
"partial type application inference" is probably a better term for what's happening here than "higher-order unification", which this most certainly is not
rename it to
-Ypartial-unification
to reflect that fact it doesn't implement a general HOU algorithm.
部分统一与高阶统一有何不同? Scala 在什么意义上没有实现高阶统一?当 Scala 无法执行 HOU 时,您能用具体的代码片段进行演示吗?
最佳答案
总的来说,如果“缺失”类型是最右边的类型,Scala 实现只会执行高阶统一。
Daniel Spiewak使用基本为 Either
的类型的仿函数实例演示了这一点,但存在偏向。
关于scala - 为什么 Scala 中的高阶统一被认为是部分的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68150413/