Discriminative sum types locate the source of type errors
Discriminative sum types locate the source of type errors
复制标题
判别和类型定位类型错误的来源
DOI:
10.1145/944705.944708
复制
发表时间:
2003
影响因子:
2.6
通讯作者:
Peter Thiemann
中科院分区:
文献类型:
--
作者:
Matthias Neubauer;Peter Thiemann
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.