Tracing ambiguity in GADT type inference
Abstract
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.
Domains
Programming Languages [cs.PL]
Origin : Files produced by the author(s)
Loading...