MLsub is a minimal language with a type system combining subtyping and parametric polymorphism and a type inference algorithm which infers compact principal types. Simple-sub is an alternative inference algorithm which can be implemented efficiently and is easier to understand. MLsub supports explicitly typed records which are not extensible. Here we extend Simple-sub with extensible records, meaning that we can add new fields to a previously defined record. For this we add row variables to our type language and extend the type constraint solving method of our type inference algorithm accordingly, keeping the decidability of type inference.
翻译:MLsub 是一种极简语言,其类型系统融合了子类型化与参数多态性,并配备能够推断紧凑主类型的类型推断算法。Simple-sub 是一种替代性推断算法,具备高效实现特性且更易于理解。MLsub 支持显式类型记录,但这些记录不可扩展。本文在 Simple-sub 中引入可扩展记录功能,使得已定义记录能够添加新字段。为此,我们在类型语言中增加行变量,并相应扩展类型推断算法的类型约束求解方法,同时保持类型推断的可判定性。