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 条
  • [31] Differentiable 3D CAD Programs for Bidirectional Editing
    Cascaval, D.
    Shalah, M.
    Quinn, P.
    Bodik, R.
    Agrawala, M.
    Schulz, A.
    COMPUTER GRAPHICS FORUM, 2022, 41 (02) : 309 - 323
  • [32] Contract lenses: Reasoning about bidirectional programs via calculation
    Zhang, Hanliang
    Tang, Wenhao
    Xie, Ruifeng
    Wang, Meng
    Hu, Zhenjiang
    JOURNAL OF FUNCTIONAL PROGRAMMING, 2023, 33 (04)
  • [33] ANTON: Composing Logic and Logic Composing
    Boenn, Georg
    Brain, Martin
    De Vos, Marina
    Ffitch, John
    LOGIC PROGRAMMING AND NONMONOTONIC REASONING, PROCEEDINGS, 2009, 5753 : 542 - +
  • [34] COMPOSING RADIO PROGRAMS + A MATINEE OF THE RADIO-SINFONIEORCHESTRA BASEL WITH MONNARD,JEAN,FRANCOIS CONDUCTING
    KELTERBORN, R
    NEUE ZEITSCHRIFT FUR MUSIK, 1992, 153 (04): : 18 - 18
  • [35] Composing
    Stuth, Tricia
    JOURNAL OF ARCHITECTURAL EDUCATION, 2018, 72 (01) : 178 - 179
  • [36] 'COMPOSING'
    CATCHINGS, M
    DEKALB LITERARY ARTS JOURNAL, 1976, 9 (02): : 48 - 48
  • [37] COMPOSING
    POURNELLE, J
    BYTE, 1986, 11 (05): : 394 - 394
  • [38] Recognizable sets of N-free pomsets are monadically axiomatizable
    Kuske, D
    DEVELOPMENTS IN LANGUAGE THEORY, 2002, 2295 : 206 - 216
  • [39] 'Composing'
    Fox, R
    PARNASSUS-POETRY IN REVIEW, 1997, 22 (1-2): : 247 - 247
  • [40] TEACHING AND PRACTICE - COMPOSING TEXTS, COMPOSING LIVES
    PERL, S
    HARVARD EDUCATIONAL REVIEW, 1994, 64 (04) : 427 - 449