I remember reading somewhere that Hindley Milner was a restriction on system-f. If that is the case, could someone please provide me with some terms that can be typed in system-f but not in HM.
Asked
Active
Viewed 599 times
1 Answers
11
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).

Andreas Rossberg
- 34,518
- 3
- 61
- 72
-
3Not sure what you mean, that expression is not a function. Definitions (bound via let) can be polymorphic with HM, but function parameters can not. – Andreas Rossberg Mar 28 '12 at 12:02