论文标题

示波器效果的结构化处理:扩展版本

Structured Handling of Scoped Effects: Extended Version

论文作者

Yang, Zhixuan, Paviotti, Marco, Wu, Nicolas, Berg, Birthe van den, Schrijvers, Tom

论文摘要

代数效应提供了一种多功能框架,涵盖了各种各样的效果。但是,界定范围的操作家族不是代数,通常被建模为处理程序,从而阻止它们与代数操作一起自由使用。尽管存在有关范围操作的建议,但它们是临时且无原则的,或者对于实际编程而言太不便了。本文提供了两全其美的最好的:一种理论上创建的范围效果模型,可方便实施和推理。我们的新模型基于局部有限的类别与函数代数类别之间的相关性。使用辅助之间的比较函数,我们表明我们的新模型,现有的索引模型和第三种方法模拟范围内的操作,以代数为代数的操作对于处理范围的操作具有相同的表达性。我们认为我们的新模型是易于实施和结构化之间的甜蜜点。此外,我们的方法会自动诱导范围内效应的处理程序的融合定律,这些定律可用于推理和优化。

Algebraic effects offer a versatile framework that covers a wide variety of effects. However, the family of operations that delimit scopes are not algebraic and are usually modelled as handlers, thus preventing them from being used freely in conjunction with algebraic operations. Although proposals for scoped operations exist, they are either ad-hoc and unprincipled, or too inconvenient for practical programming. This paper provides the best of both worlds: a theoretically-founded model of scoped effects that is convenient for implementation and reasoning. Our new model is based on an adjunction between a locally finitely presentable category and a category of functorial algebras. Using comparison functors between adjunctions, we show that our new model, an existing indexed model, and a third approach that simulates scoped operations in terms of algebraic ones have equal expressivity for handling scoped operations. We consider our new model to be the sweet spot between ease of implementation and structuredness. Additionally, our approach automatically induces fusion laws of handlers of scoped effects, which are useful for reasoning and optimisation.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源