Spine-local Type Inference

05/25/2018
by   Christopher Jenkins, et al.
0

We present spine-local type inference, a partial type inference system for inferring omitted type annotations for System F terms based on local type inference. Local type inference relies on bidirectional inference rules to propagate type information into and out of adjacent nodes of the AST and restricts type-argument inference to occur only within a single node. Spine-local inference relaxes the restriction on type-argument inference by allowing it to occur only within an application spine and improves upon it by using contextual type-argument inference. As our goal is to explore the design space of local type inference, we show that, relative to other variants, spine-local type inference enables desirable features such as first-class curried applications, partial type applications, and the ability to infer types for some terms not otherwise possible. Our approach enjoys usual properties of a bidirectional system of having a specification for our inference algorithm and predictable requirements for typing annotations, and in particular maintains some the advantages of local type inference such as a relatively simple implementation and a tendency to produce good-quality error messages when type inference fails.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/03/2022

Implicit Polarized F: local type inference for impredicativity

System F, the polymorphic lambda calculus, features the principle of imp...
research
08/16/2019

Bidirectional Typing

Bidirectional typing combines two modes of typing: type checking, which ...
research
06/28/2019

Bidirectional Type Class Instances (Extended Version)

GADTs were introduced in Haskell's eco-system more than a decade ago, bu...
research
07/05/2018

Gradual Liquid Type Inference

Liquid typing provides a decidable refinement inference mechanism that i...
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/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
11/01/2019

A Modular Inference of Linear Types for Multiplicity-Annotated Arrows

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

Please sign up or login with your details

Forgot password? Click here to reset