无需元组的可逆语法(函数式珍珠)
Invertible Syntax without the Tuples (Functional Pearl)
AI总结:
本文重新审视 Danvy 的延续传递见解,提出三种利用延续传递风格的解决方案,作为依赖类型和嵌套对幺半群聚合的替代方案,用于解析和打印具有递增表达能力的结构化数据。
摘要:
在开创性论文《Functional unparsing》中,Olivier Danvy 使用延续传递将类似 printf 的格式字符串重新分析为组合子。在随后的几十年里,研究重点转向了另一条并发工作线——应用函子、单子或基于箭头的组合子库——旨在为可逆语法描述寻找组合子,使其同时确定解析器和打印机,并具备更强的表达能力,能够处理列表和树等归纳结构。在此过程中,延续传递被遗忘了。本文论证了 Danvy 的见解在通用环境中与在其原始论文的受限环境中同样适用。与 Danvy 一样,我们提出了三种解决方案,利用延续传递风格作为依赖类型和通过嵌套对进行幺半群聚合的替代方案,在我们的案例中用于解析和打印具有递增表达能力的结构化数据。
英文摘要:
In the seminal paper Functional unparsing, Olivier Danvy used continuation passing to reanalyse printf-like format strings as combinators. In the intervening decades, the conversation shifted towards a concurrent line of work -- applicative, monadic or arrow-based combinator libraries -- in an effort to find combinators for invertible syntax descriptions that simultaneously determine a parser as well as a printer, and with more expressive power, able to handle inductive structures such as lists and trees. Along the way, continuation passing got lost. This paper argues that Danvy's insight remains as relevant to the general setting as it was to the restricted setting of his original paper. Like him, we present three solutions that exploit continuation-passing style as an alternative to both dependent types and monoidal aggregation via nested pairs, in our case to parse and print structured data with increasing expressive power.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。