Invertible Syntax without the Tuples (Functional Pearl)
Mathieu Boespflug, Arnaud Spiwack

TL;DR
This paper revisits Danvy's continuation-passing approach to invertible syntax, demonstrating its relevance and providing three solutions that enhance expressive power for parsing and printing structured data.
Contribution
It introduces three continuation-passing style solutions that improve invertible syntax descriptions without relying on tuples or dependent types.
Findings
Reaffirms the relevance of continuation-passing style for invertible syntax
Provides three novel solutions for structured data parsing and printing
Enhances expressive power beyond previous combinator libraries
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
