Discriminative sum types locate the source of type errors
Author(s) -
Matthias Neubauer,
Peter Thiemann
Publication year - 2003
Publication title -
citeseer x (the pennsylvania state university)
Language(s) - English
Resource type - Conference proceedings
ISSN - 0362-1340
ISBN - 1-58113-756-7
DOI - 10.1145/944705.944708
Subject(s) - type inference , subtyping , type (biology) , inference , computer science , discriminative model , decidability , principal (computer security) , type theory , term (time) , artificial intelligence , natural language processing , algorithm , theoretical computer science , programming language , ecology , physics , quantum mechanics , biology , operating system
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.
Accelerating Research
Robert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom
Address
John Eccles HouseRobert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom