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

04/01/2020
by   Frank Emrich, et al.
0

ML is remarkable in providing statically typed polymorphism without the programmer ever having to write any type annotations. The cost of this parsimony is that the programmer is limited to a form of polymorphism in which quantifiers can occur only at the outermost level of a type and type variables can be instantiated only with monomorphic types. Type inference for unrestricted System F-style polymorphism is undecidable in general. Nevertheless, the literature abounds with a range of proposals to bridge the gap between ML and System F. We put forth a new proposal, FreezeML, a conservative extension of ML with two new features. First, let- and lambda-binders may be annotated with arbitrary System F types. Second, variable occurrences may be frozen, explicitly disabling instantiation. FreezeML is equipped with type-preserving translations back and forth between System F and admits a type inference algorithm, an extension of algorithm W, that is sound and complete and which yields principal types.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/30/2018

Dynamic Type Inference for Gradual Hindley--Milner Typing

Garcia and Cimini study a type inference problem for the ITGL, an implic...
research
07/20/2022

Constraint-based type inference for FreezeML

FreezeML is a new approach to first-class polymorphic type inference tha...
research
06/09/2018

Type variables in patterns

For many years, GHC has implemented an extension to Haskell that allows ...
research
08/04/2020

Intensional Datatype Refinement

The pattern-match safety problem is to verify that a given functional pr...
research
03/03/2022

Implicit Polarized F: local type inference for impredicativity

System F, the polymorphic lambda calculus, features the principle of imp...
research
11/01/2019

Modular Inference of Linear Types for Multiplicity-Annotated Arrows

Bernardy et al. [2018] proposed a linear type system λ^q_→ as a core typ...
research
05/25/2018

Spine-local Type Inference

We present spine-local type inference, a partial type inference system f...

Please sign up or login with your details

Forgot password? Click here to reset