Hindley Milnerで表現できないSystem-Fのタイプや用語は何ですか
-
14-11-2019 - |
質問
ハンディーミルナーがSystem-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).
所属していません StackOverflow