arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1601.02484cs.PL
收藏

关于一元透镜的思考

Reflections on Monadic Lenses

Faris Abou-Saleh, James Cheney, Jeremy Gibbons, James McKinna, Perdita Stevens

摘要:

双向转换(bx)主要被建模为纯函数,并且不考虑大多数程序设计语言中可能存在的副作用。最近,在实践者和学术研究中,已经提出了几种使用单子来解释效应的bx公式。bx与effects的结合令人惊讶地微妙,导致其中一些提案出现问题,并增加了其他提案的复杂性。本文回顾了迄今为止关于一元透镜的建议,并提供了一些改进的定义,特别注意天真地将一元效应添加到现有的纯bx定义(如透镜和对称透镜)中的障碍,以及在效应存在下对称双向变换的等价性的微妙之处。

英文摘要:

Bidirectional transformations (bx) have primarily been modeled as pure functions, and do not account for the possibility of the side-effects that are available in most programming languages. Recently several formulations of bx that use monads to account for effects have been proposed, both among practitioners and in academic research. The combination of bx with effects turns out to be surprisingly subtle, leading to problems with some of these proposals and increasing the complexity of others. This paper reviews the proposals for monadic lenses to date, and offers some improved definitions, paying particular attention to the obstacles to naively adding monadic effects to existing definitions of pure bx such as lenses and symmetric lenses, and the subtleties of equivalence of symmetric bidirectional transformations in the presence of effects.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑