Discriminative sum types locate the source of type errors

  • Authors:
  • Matthias Neubauer;Peter Thiemann

  • Affiliations:
  • Universität Freiburg;Universität Freiburg

  • Venue:
  • ICFP '03 Proceedings of the eighth ACM SIGPLAN international conference on Functional programming
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

We propose a type system for locating the source of type errors in an applied lambda calculus with ML-style polymorphism. The system is based on discriminative sum types---known from work on soft typing---with annotation subtyping and recursive types. This way, type clashes can be registered in the type for later reporting. The annotations track the potential producers and consumers for each value so that clashes can be traced to their cause.Every term is typeable in our system and type inference is decidable. A type derivation in our system describes all type errors present in the program, so that a principal derivation yields a principal description of all type errors present. Error messages are derived from completed type derivations. Thus, error messages are independent of the particular algorithm used for type inference, provided it constructs such a derivation.