Composing Bidirectional Programs Monadically

被引:5
|
作者
Xia, Li-yao [1 ]
Orchard, Dominic [2 ]
Wang, Meng [3 ]
机构
[1] Univ Penn, Philadelphia, PA 19104 USA
[2] Univ Kent, Canterbury, Kent, England
[3] Univ Bristol, Bristol, Avon, England
基金
英国工程与自然科学研究理事会;
关键词
D O I
10.1007/978-3-030-17184-1_6
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:147 / 175
页数:29
相关论文
共 50 条
  • [21] Towards Bidirectional Live Programming for Incomplete Programs
    Zhang, Xing
    Hu, Zhenjiang
    2022 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2022), 2022, : 2154 - 2164
  • [22] Bidirectional Answer Set Programs with Function Symbols
    Eiter, Thomas
    Simkus, Mantas
    21ST INTERNATIONAL JOINT CONFERENCE ON ARTIFICIAL INTELLIGENCE (IJCAI-09), PROCEEDINGS, 2009, : 765 - 771
  • [23] Maximum Segment Sum, Monadically (distilled tutorial)
    Gibbons, Jeremy
    ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2011, (66): : 181 - 194
  • [24] Synbit: synthesizing bidirectional programs using unidirectional sketches
    Masaomi Yamaguchi
    Kazutaka Matsuda
    Cristina David
    Meng Wang
    Formal Methods in System Design, 2022, 61 : 198 - 247
  • [25] Synbit: synthesizing bidirectional programs using unidirectional sketches
    Yamaguchi, Masaomi
    Matsuda, Kazutaka
    David, Cristina
    Wang, Meng
    FORMAL METHODS IN SYSTEM DESIGN, 2022, 61 (2-3) : 198 - 247
  • [26] SYNBIT: Synthesizing Bidirectional Programs using Unidirectional Sketches
    Yamaguchi, Masaomi
    Matsuda, Kazutaka
    David, Cristina
    Wang, Meng
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2021, 5 (OOPSLA):
  • [27] An Efficient Composition of Bidirectional Programs by Memoization and Lazy Update
    Tsushima, Kanae
    Trong, Bach Nguyen
    Gluck, Robert
    Hu, Zhenjiang
    FUNCTIONAL AND LOGIC PROGRAMMING, FLOPS 2020, 2020, 12073 : 159 - 178
  • [28] Additive Cellular Automata Graded-Monadically
    Capobianco, Silvio
    Uustalu, Tarmo
    PROCEEDINGS OF THE 25TH INTERNATIONAL SYMPOSIUM ON PRINCIPLES AND PRACTICE OF DECLARATIVE PROGRAMMING, PPDP 2023, 2023,
  • [29] Correction to: Strong atoms in monadically Krull monoids
    Gerhard Angermüller
    Semigroup Forum, 2022, 104 (1) : 211 - 211