DeepAI AI Chat
Log In Sign Up

Spine-local Type Inference

by   Christopher Jenkins, et al.
The University of Iowa

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.


page 1

page 2

page 3

page 4


Implicit Polarized F: local type inference for impredicativity

System F, the polymorphic lambda calculus, features the principle of imp...

Bidirectional Typing

Bidirectional typing combines two modes of typing: type checking, which ...

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

ML is remarkable in providing statically typed polymorphism without the ...

Gradual Liquid Type Inference

Liquid typing provides a decidable refinement inference mechanism that i...

Bidirectional Type Class Instances (Extended Version)

GADTs were introduced in Haskell's eco-system more than a decade ago, bu...

Inference Algorithms for Similarity Networks

We examine two types of similarity networks each based on a distinct not...

A Modular Inference of Linear Types for Multiplicity-Annotated Arrows

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