Principal Type Schemes for Functional Programs with Overloading and Subtyping
user correction - Legacy Corrections
Geoffrey S. Smith
SVM HeaderParse 0.1
Cornell University; y
SVM HeaderParse 0.2
We show how the Hindley/Milner polymorphic type system can be extended to incorporate overloading and subtyping. Our approach is to attach constraints to quantified types in order to restrict the allowed instantiations of type variables. We present an algorithm for inferring principal types and prove its soundness and completeness. We find that it is necessary in practice to simplify the inferred types, and we describe techniques for type simplification that involve shape unification, strongly connected components, transitive reduction, and the monotonicities of type formulas.