Tracing ambiguity in GADT type inference
Résumé
GADTs, short for Generalized Algebraic DataTypes, extend usual algebraicdatatypes with a form of dependent typing that has many usefulapplications, but raises serious issues for type inference. Patternmatching on GADTs introduces type equalities with limited scopes, whichare a source of ambiguities that may destroy principal types---and mustbe resolved by type annotations. By tracing ambiguities in types, we maytighten the definition of ambiguities and confine them, so as to requestfewer type annotations. Now in use in OCaml 4.00, this solution alsolifts some restriction on object types and polymorphic types thatappeared in a previous implementation of GADTs in OCaml.
Domaines
Langage de programmation [cs.PL]Origine | Fichiers produits par l'(les) auteur(s) |
---|
Loading...