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

使用代数效果和处理程序编程

Programming with Algebraic Effects and Handlers

Andrej Bauer, Matija Pretnar

摘要:

Eff是一种基于计算效果的代数方法的程序设计语言,其中效果被视为代数运算,效果处理程序被视为自由代数的同态。Eff支持一流的效果和处理程序,通过它们,我们可以轻松定义新的计算效果,无缝地组合现有的效果,并以新颖的方式处理它们。我们给出了一个指称语义的EFF和讨论的原型实现的基础上,通过例子,我们演示了如何在EFF的标准效果处理,以及如何EFF支持编程技术,使用各种形式的定界延续,如回溯,广度优先搜索,选择功能,合作多线程,和其他。

英文摘要:

Eff is a programming language based on the algebraic approach to computational effects, in which effects are viewed as algebraic operations and effect handlers as homomorphisms from free algebras. Eff supports first-class effects and handlers through which we may easily define new computational effects, seamlessly combine existing ones, and handle them in novel ways. We give a denotational semantics of eff and discuss a prototype implementation based on it. Through examples we demonstrate how the standard effects are treated in eff, and how eff supports programming techniques that use various forms of delimited continuations, such as backtracking, breadth-first search, selection functionals, cooperative multi-threading, and others.

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

↑