Composing bidirectional programs monadically (with appendices)

02/19/2019
by   Li-yao Xia, et al.
0

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.

READ FULL TEXT
research
08/31/2021

Synbit: Synthesizing Bidirectional Programs using Unidirectional Sketches

We propose a technique for synthesizing bidirectional programs from the ...
research
05/13/2022

From Logic to Functional Logic Programs

Logic programming is a flexible programming paradigm due to the use of p...
research
08/17/2021

Higher-Order Concurrency for Microcontrollers

Programming microcontrollers involves low-level interfacing with hardwar...
research
12/12/2018

Bidirectional Type Checking for Relational Properties

Relational type systems have been designed for several applications incl...
research
05/19/2020

Choreographies as Objects

We present Choral, the first framework for programming choreographies (m...
research
11/17/2020

Learning functional programs with function invention and reuse

Inductive programming (IP) is a field whose main goal is synthesising pr...

Please sign up or login with your details

Forgot password? Click here to reset