Implicit Polarized F: local type inference for impredicativity

03/03/2022
by   Henry Mercer, et al.
0

System F, the polymorphic lambda calculus, features the principle of impredicativity: polymorphic types may be (explicitly) instantiated at other types, enabling many powerful idioms such as Church encoding and data abstraction. Unfortunately, type applications need to be implicit for a language to be human-usable, and the problem of inferring all type applications in System F is undecidable. As a result, language designers have historically avoided impredicative type inference. We reformulate System F in terms of call-by-push-value, and study type inference for it. Surprisingly, this new perspective yields a novel type inference algorithm which is extremely simple to implement (not even requiring unification), infers many types, and has a simple declarative specification. Furthermore, our approach offers type theoretic explanations of how many of the heuristics used in existing algorithms for impredicative polymorphism arise.

READ FULL TEXT
research
05/25/2018

Spine-local Type Inference

We present spine-local type inference, a partial type inference system f...
research
09/13/2023

EXPRESSing Session Types

To celebrate the 30th edition of EXPRESS and the 20th edition of SOS we ...
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
04/01/2020

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

ML is remarkable in providing statically typed polymorphism without the ...
research
11/22/2019

ptype: Probabilistic Type Inference

Type inference refers to the task of inferring the data type of a given ...
research
02/24/2023

Set-theoretic Types for Erlang

Erlang is a functional programming language with dynamic typing. The lan...
research
07/25/2017

An Executable Specification of Typing Rules for Extensible Records based on Row Polymorphism

Type inference is an application domain that is a natural fit for logic ...

Please sign up or login with your details

Forgot password? Click here to reset