FreezeML is a new approach to first-class polymorphic type inference that employs term annotations to control when and how polymorphic types are instantiated and generalised. It conservatively extends Hindley-Milner type inference and was first presented as an extension to Algorithm W. More modern type inference techniques such as HM(X) and OutsideIn($X$) employ constraints to support features such as type classes, type families, rows, and other extensions. We take the first step towards modernising FreezeML by presenting a constraint-based type inference algorithm. We introduce a new constraint language, inspired by the Pottier/R\'emy presentation of HM(X), in order to allow FreezeML type inference problems to be expressed as constraints. We present a deterministic stack machine for solving FreezeML constraints and prove its termination and correctness.
翻译:冻结洗钱法是对一流多形态类型推断的一种新方法,它使用术语说明来控制何时和如何立即和普遍地控制多形态类型。它保守地扩展了Hindley-Milner类型的推断,首先作为Agorithm W的延伸。 更现代类型的推断技术,如HM(X)和OuterIn(X$X$),对支持类型类别、类型家庭、行和其他扩展等特征施加了限制。我们通过提出基于限制的推断算法,朝着使冻结洗钱法现代化迈出了第一步。我们引入了一种受Pottier/R\'emy HM(X)介绍启发的新的约束语言,以便允许将冻结洗钱法类型的推断问题表述为限制。我们提出了一种用于解决冻结洗钱法约束并证明其终止和正确性的确定型堆叠机器。