计算机科学 > 程序设计语言
[提交于 2019年2月19日]
标题:Composing bidirectional programs monadically (with appendices)
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要: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.
提交历史
来自:Dominic Orchard[v1] 2019年2月19日 星期二 08:47:23 UTC