Greedy bidirectional polymorphism

  • Authors:
  • Joshua Dunfield

  • Affiliations:
  • McGill University, Montréal, Canada

  • Venue:
  • Proceedings of the 2009 ACM SIGPLAN workshop on ML
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Bidirectional typechecking has become popular in advanced type systems because it works in many situations where inference is undecidable. In this paper, I show how to cleanly handle parametric polymorphism in a bidirectional setting. The key contribution is a bidirectional type system for a subset of ML that supports first-class (higher-rank and even impredicative) polymorphism, and is complete for predicative polymorphism (including ML-style polymorphism and higher-rank polymorphism). The system's power comes from bidirectionality combined with a "greedy" method of finding polymorphic instances inspired by Cardelli's early work on System F:. This work demonstrates that bidirectionality is a good foundation for traditionally vexing features like first-class polymorphism.