paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Generalized monoidal effects and handlers

广义幺半效应与处理器
JFP vol.302020匹配度 2/10 · 该论文属于函数式编程与范畴论中的代数效应/处理器理论,将 monad 推广到广义幺半,虽与 PL 和形式化相关,但未涉及用户核心关注的 AI、Agentic 程序、静态分析、浮点程序分析或贝叶斯程序分析。引用 4 inbox
RUBEN P. PIETERS, EXEQUIEL RIVAS, TOM SCHRIJVERS
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:把代数效应与处理器从 monad 推广到广义幺半,统一 monad、applicative 与 arrow 并支持处理器复用。

传统代数效应与处理器基于 monad 组织效应,但许多副作用并非 monad 式。本文将效应与处理器从 monad 推广到广义幺半,把范畴论基础从自由代数改为自由幺半,从而统一 monad、applicative functor 与 arrow 等计算类。作者进一步用 lax monoidal functor 支持处理器和程序跨计算类复用,例如以 monadic 处理器处理 applicative 计算。文中以构建系统为主要用例,把任务视为自由计算并由处理器解释。该工作扩展了处理器接口的适用范围,评估以理论构造和构建系统示例为主。

问题
传统代数效应与处理器仅适用于 monad 式副作用,无法覆盖 applicative、arrow 等非 monad 计算。
方法
把范畴论基础从自由代数换成自由幺半,并借助 lax monoidal functor 实现处理器跨计算类复用。
评估
摘要未报告实验评估,主要通过构建系统用例和范畴论构造展示方法的适用性。
原文摘要(Abstract)

Abstract 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). PACMPL 2 (ICFP), 79:1–79:29.].

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@article{PietersRS20,
  title = {Generalized monoidal effects and handlers},
  author = {RUBEN P. PIETERS and EXEQUIEL RIVAS and TOM SCHRIJVERS},
  journal = {Journal of Functional Programming},
  volume = {30},
  year = {2020},
  doi = {10.1017/s0956796820000106}
}