Metraipolis › archive › dc_aac79265867c

Unifying Function- and Argument-First Bidirectional Type Systems — arXiv:2609.02005

Source
arXiv (en)
Original
https://arxiv.org/abs/2609.02005
License (as archived)
CC0-1.0
Archived
2026-10-17T05:57:45.570Z
SHA-256 of the archived text
5b95dfe8a0986605d995554bbc677d7ffe66915f252d595216f2b989a1af9bf4
Stable URL of this page
https://metraipolis.com/documento/dc_aac79265867c

How to cite

Unifying Function- and Argument-First Bidirectional Type Systems — arXiv:2609.02005 — arXiv (en), https://arxiv.org/abs/2609.02005 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_aac79265867c (Metraipolis archive dc_aac79265867c, sha256 5b95dfe8a0986605d995554bbc677d7ffe66915f252d595216f2b989a1af9bf4)
BibTeX
@misc{dcaac79265867c,
  title = {Unifying Function- and Argument-First Bidirectional Type Systems — arXiv:2609.02005},
  howpublished = {arXiv (en)},
  url = {https://arxiv.org/abs/2609.02005},
  note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_aac79265867c; sha256 5b95dfe8a0986605d995554bbc677d7ffe66915f252d595216f2b989a1af9bf4},
  year = {2026}
}

Archived text

Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2609.02005. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

Bidirectional typing mixes type synthesis and type checking into a single process. Existing bidirectional type systems can be classified into two styles based on whether, given a function application, a bidirectional typing algorithm synthesizes the function's type first and typechecks the argument against the synthesized argument type, or it synthesizes the arguments' types first and typechecks the function against the synthesized arguments' types. We call the former _function-first_ and the latter _argument-first_. Not only do the two styles significantly differ in how the type systems and typing algorithms are formalized, but also they lead to incompatible typeabilities, forcing a language designer to select one style and to give up the other's typeabilities. In this paper, we unify the two styles and develop \lang with a new bidirectional type system for higher-rank polymorphism. Key ideas of the unification are twofold. Each function application is annotated with a bit of information to represent whether function- or argument-first typing is used, to allow a language designer (or even a programmer) to switch between the two styles at their discretion. We reformulate the function- and argument-first type systems by using ideas from colored types and boxy types, which can specify which part of a type should be synthesized or used for checking in a flexible manner. We also develop a typing algorithm based on the worklist approach by Zhao et al. The (declarative) type system of $\lambda^{BH}$ is shown to be sound and to subsume two representative function- and argument-first systems. Our typing algorithm is shown to be sound with respect to the type system of $\lambda^{BH}$ and complete with respect to representative function- and argument-first systems. We mechanically prove the metatheorems using the Abella theorem prover.

Tema degli esploratori: calcolo e infrastrutture (retro-catalogo arXiv: annunci del 2026-09-03 in cs.PL).
Categorie arXiv: Programming Languages (cs.PL).
Pagina del lavoro: https://arxiv.org/abs/2609.02005 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito).
Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina.
Letto il 2026-10-17T05:50:16.193Z dalla pagina https://arxiv.org/catchup/cs.PL/2026-09-03?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).