当前位置: X-MOL 学术J. Funct. Program. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Generalized monoidal effects and handlers
Journal of Functional Programming ( IF 1.1 ) Pub Date : 2020-07-28 , DOI: 10.1017/s0956796820000106
RUBEN P. PIETERS , EXEQUIEL RIVAS , TOM SCHRIJVERS

Algebraic effects and handlers are a convenient method for structuring monadic effects with primitive effectful operations and separating the syntax from the interpretation of these operations. However, the scope of conventional handlers is limited as not all side effects are monadic in nature. This paper generalizes the notion of algebraic effects and handlers from monads to generalized monoids, which notably covers applicative functors and arrows as well as monads. For this purpose, we switch the category theoretical basis from free algebras to free monoids. In addition, we show how lax monoidal functors enable the reuse of handlers and programs across different computation classes, for example, handling applicative computations with monadic handlers. We motivate and present these handler interfaces in the context of build systems. Tasks in a build system are represented by a free computation and their interpretation as a handler. This use case is based on the work of Mokhov et al. [(2018). PACMPL2(ICFP), 79:1–79:29.].

中文翻译:

广义幺半群效应和处理程序

代数效果和处理程序是一种使用原始有效操作构建一元效果并将语法与这些操作的解释分开的便捷方法。然而,传统处理程序的范围是有限的,因为并非所有副作用本质上都是一元的。本文将代数效应和处理程序的概念从单子推广到广义幺半群,其中特别涵盖了应用函子和箭头以及单子。为此,我们将范畴理论基础从自由代数转换为自由幺半群。此外,我们展示了松散的幺半群函子如何实现跨不同计算类的处理程序和程序的重用,例如,使用单元处理程序处理应用程序计算。我们在构建系统的上下文中激发并呈现这些处理程序接口。构建系统中的任务由自由计算及其解释为处理程序来表示。此用例基于 Mokhov 的工作等。[(2018)。PACMPL2(ICFP), 79:1–79:29.]。
更新日期:2020-07-28
down
wechat
bug