Simple unification-based type inference for GADTs

  • Authors:
  • Simon Peyton Jones;Dimitrios Vytiniotis;Stephanie Weirich;Geoffrey Washburn

  • Affiliations:
  • Microsoft Research, Cambridge;University of Pennsylvania;University of Pennsylvania;University of Pennsylvania

  • Venue:
  • Proceedings of the eleventh ACM SIGPLAN international conference on Functional programming
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Generalized algebraic data types (GADTs), sometimes known as "guarded recursive data types" or "first-class phantom types", are a simple but powerful generalization of the data types of Haskell and ML. Recent works have given compelling examples of the utility of GADTs, although type inference is known to be difficult. Our contribution is to show how to exploit programmer-supplied type annotations to make the type inference task almost embarrassingly easy. Our main technical innovation is wobbly types, which express in a declarative way the uncertainty caused by the incremental nature of typical type-inference algorithms.