Bidirectional Typing with Freezing, Skeletons, and Ghosts

๐Ÿ“… 2026-07-17
๐Ÿ“ˆ Citations: 0
โœจ Influential: 0
๐Ÿ“„ PDF
๐Ÿค– AI Summary
Traditional bidirectional type inference struggles to support first-class polymorphism and faces limitations in balancing flexibility and predictability in mixed information flow. This work proposes Fresco, the first approach integrating skeleton, phantom, and freeze mechanisms: skeletons enable localized bidirectional type information flow between functions and arguments, phantoms represent unknown types, and the freeze mechanism allows users to explicitly control the direction of information flow. Fresco supports flexible yet predictable type inference for first-class polymorphism and extends naturally to modal effect type systems. We present a concise declarative specification along with a corresponding algorithm, prove its soundness and completeness relative to the declarative system, and demonstrate through a prototype implementation that Fresco offers superior expressiveness, controllability, and extensibility.
๐Ÿ“ Abstract
Bidirectional typing makes use of local information flow between functions and arguments. Conventional bidirectional typing only supports unidirectional information flow, typically from functions to arguments, which is insufficient to infer first-class polymorphism. Existing work on improving information flow either has limited support for mixed information flow or requires ad hoc mechanisms that harm predictability. We propose Fresco, a novel bidirectional type inference approach to first-class polymorphism. Fresco enables local type information to flow back and forth between functions and arguments via skeletons, with ghosts representing unknown type information, and allows users to customise the direction of information flow by freezing. The flexible information flow of Fresco enables expressive and predictable inference for first-class polymorphism. We provide a declarative specification for Fresco, a simple type inference algorithm that is sound and complete with respect to the declarative system, and a prototype implementation that further generalises Fresco to infer modal effect types.
Problem

Research questions and friction points this paper is trying to address.

bidirectional typing
first-class polymorphism
type inference
information flow
type systems
Innovation

Methods, ideas, or system contributions that make the work stand out.

bidirectional typing
first-class polymorphism
type inference
information flow
modal effect types
๐Ÿ”Ž Similar Papers
No similar papers found.