我记得在某个地方阅读Hindley Milner对系统-F的限制。如果是这种情况,请有人可以向我提供可以在System-F中键入但不在HM中的一些术语。

有帮助吗?

解决方案

Anything involving higher-ranked (i.e. "first-class") polymorphism. For example:

lambda f : (forall A. A -> A). (f Int 1, f String "hello")

This function would have the type (forall A. A -> A) -> Int * String, which is not expressible in HM, where all polymorphic type schemes must be in "prenex" form (i.e. the quantifier may only occur on the outside, never nested).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top