2019/02/19 by Li-yao Xia, Dominic Orchard, Xia, Li-yao +3
Computer Science · #FOS: Computer and information sciences #Logic, programming, and type systems #Model-Driven Software Engineering Techniques #Programming Languages (cs.PL) #Software Engineering Research #cs.PL
paper · pdf · doi:10.48550/arxiv.1902.06950
Provides the appendices of the paper, which appears in the proceedings of European Symposium on Programming (ESOP) 2019
arxiv created 2019/02/19 · openalex publication_date 2019/02/19 · arxiv updated 2019/02/20 · openalex created_date 2025/10/10 · openalex updated_date 2026/07/28
Software frequently converts data from one representation to another and vice versa. Naively specifying both conversion directions separately is error prone and introduces conceptual duplication. Instead, bidirectional programming techniques allow programs to be written which can be interpreted in both directions. However, these techniques often employ unfamiliar programming idioms via restricted, specialised combinator libraries. Instead, we introduce a framework for composing bidirectional programs monadically, enabling bidirectional programming with familiar abstractions in functional languages such as Haskell. We demonstrate the generality of our approach applied to parsers/printers, lenses, and generators/predicates. We show how to leverage compositionality and equational reasoning for the verification of round-tripping properties for such monadic bidirectional programs.