计算机科学 > 程序设计语言
[提交于 2024年5月20日 (v1),最后修订于 2024年5月20日 (此版本, v2)]
标题:Scoped Effects as Parameterized Algebraic Theories
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:Notions of computation can be modelled by monads. Algebraic effects offer a characterization of monads in terms of algebraic operations and equational axioms, where operations are basic programming features, such as reading or updating the state, and axioms specify observably equivalent expressions. However, many useful programming features depend on additional mechanisms such as delimited scopes or dynamically allocated resources. Such mechanisms can be supported via extensions to algebraic effects including scoped effects and parameterized algebraic theories. We present a fresh perspective on scoped effects by translation into a variation of parameterized algebraic theories. The translation enables a new approach to equational reasoning for scoped effects and gives rise to an alternative characterization of monads in terms of generators and equations involving both scoped and algebraic operations. We demonstrate the power of our fresh perspective by way of equational characterizations of several known models of scoped effects.
提交历史
来自:Cristina Matache[v2] 2024年5月20日 星期一 10:28:52 UTC