English

Composing bidirectional programs monadically (with appendices)

Programming Languages 2019-02-20 v1

Abstract

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.

Keywords

Cite

@article{arxiv.1902.06950,
  title  = {Composing bidirectional programs monadically (with appendices)},
  author = {Li-yao Xia and Dominic Orchard and Meng Wang},
  journal= {arXiv preprint arXiv:1902.06950},
  year   = {2019}
}

Comments

Provides the appendices of the paper, which appears in the proceedings of European Symposium on Programming (ESOP) 2019