Constraint-based type inference for FreezeML

07/20/2022
by   Frank Emrich, et al.
0

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émy 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/10/2021

Linear Constraints

A linear argument must be consumed exactly once in the body of its funct...
research
05/18/2022

Global Type Inference for Featherweight Generic Java

Java's type system mostly relies on type checking augmented with local t...
research
04/01/2020

FreezeML: Complete and Easy Type Inference for First-Class Polymorphism

ML is remarkable in providing statically typed polymorphism without the ...
research
06/29/2017

Constrained Type Families

We present an approach to support partiality in type-level computation w...
research
02/17/2020

Fractional Types: Expressive and Safe Space Management for Ancilla Bits

In reversible computing, the management of space is subject to two broad...
research
11/12/2019

Kind Inference for Datatypes: Technical Supplement

In recent years, languages like Haskell have seen a dramatic surge of ne...
research
03/31/2022

An Affine Type System with Hindley-Milner Style Type Inference

This article first provides an algorithm W based type inference algorith...

Please sign up or login with your details

Forgot password? Click here to reset