Invertible Syntax without the Tuples (Functional Pearl)

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Boespflug, Mathieu, Spiwack, Arnaud
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866914135205216256
author Boespflug, Mathieu
Spiwack, Arnaud
author_facet Boespflug, Mathieu
Spiwack, Arnaud
contents In the seminal paper Functional unparsing, Olivier Danvy used continuation passing to reanalyse printf-like format strings as combinators. In the intervening decades, the conversation shifted towards a concurrent line of work -- applicative, monadic or arrow-based combinator libraries -- in an effort to find combinators for invertible syntax descriptions that simultaneously determine a parser as well as a printer, and with more expressive power, able to handle inductive structures such as lists and trees. Along the way, continuation passing got lost. This paper argues that Danvy's insight remains as relevant to the general setting as it was to the restricted setting of his original paper. Like him, we present three solutions that exploit continuation-passing style as an alternative to both dependent types and monoidal aggregation via nested pairs, in our case to parse and print structured data with increasing expressive power.
format Preprint
id arxiv_https___arxiv_org_abs_2508_09856
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Invertible Syntax without the Tuples (Functional Pearl)
Boespflug, Mathieu
Spiwack, Arnaud
Programming Languages
In the seminal paper Functional unparsing, Olivier Danvy used continuation passing to reanalyse printf-like format strings as combinators. In the intervening decades, the conversation shifted towards a concurrent line of work -- applicative, monadic or arrow-based combinator libraries -- in an effort to find combinators for invertible syntax descriptions that simultaneously determine a parser as well as a printer, and with more expressive power, able to handle inductive structures such as lists and trees. Along the way, continuation passing got lost. This paper argues that Danvy's insight remains as relevant to the general setting as it was to the restricted setting of his original paper. Like him, we present three solutions that exploit continuation-passing style as an alternative to both dependent types and monoidal aggregation via nested pairs, in our case to parse and print structured data with increasing expressive power.
title Invertible Syntax without the Tuples (Functional Pearl)
topic Programming Languages
url https://arxiv.org/abs/2508.09856