Was sind einige Arten und / oder Begriffe in System-F, die nicht in Hindley-Milner ausgedrückt werden können

StackOverflow https://stackoverflow.com/questions/9515956

Frage

Ich erinnere mich an das Lesen irgendwo, wo Hindley Milner eine Einschränkung des Systems-f war.Wenn das der Fall ist, könnte mir jemand bitte einige Begriffe geben, die in System-F in HM eingegeben werden können, jedoch nicht in HM.

War es hilfreich?

Lösung

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).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top