当前位置: 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.)
Effekt: Capability-passing style for type- and effect-safe, extensible effect handlers in Scala
Journal of Functional Programming ( IF 1.1 ) Pub Date : 2020-03-31 , DOI: 10.1017/s0956796820000027
JONATHAN IMMANUEL BRACHTHÄUSER , PHILIPP SCHUSTER , KLAUS OSTERMANN

Effect handlers are a promising way to structure effectful programs in a modular way. We present the Scala libraryEffekt, which is centered around capability passing and implemented in terms of a monad for multi-prompt delimited continuations.Effektis the first library implementation of effect handlers that supports effect safety and effect polymorphism without resorting to type-level programming. We describe a novel way of achieving effect safety using intersection types and path-dependent types. The effect system of our library design fits well into the programming paradigm of capability passing and is inspired by the effect system of Zhang & Myers (2019,Proc. ACM Program. Lang.3(POPL), 5:1-5:29). Capabilities carry an abstract type member, which represents an individual effect type and reflects the use of the capability on the type level. We represent effect rows as the contravariant intersection of effect types. Handlers introduce capabilities and remove components of the intersection type. Reusing the existing type system of Scala, we get effect subtyping and effect polymorphism for free.

中文翻译:

Effekt:Scala 中类型和效果安全、可扩展的效果处理程序的能力传递风格

效果处理程序是一种以模块化方式构建有效程序的有前途的方法。我们介绍 Scala 库效果,它以能力传递为中心,并根据用于多提示分隔的延续的单子来实现。效果是效果处理程序的第一个库实现,它支持效果安全性和效果多态性,而无需诉诸类型级编程。我们描述了一种使用交叉口类型和路径相关类型实现效果安全的新方法。我们库设计的效果系统非常适合能力传递的编程范式,并受到 Zhang & Myers (2019,过程。ACM 计划。朗。3(POPL), 5:1-5:29)。能力携带一个抽象类型成员,它代表一个单独的效果类型,反映了能力在类型级别上的使用。我们将效果行表示为效果类型的逆变交集。处理程序引入功能并删除交集类型的组件。重用Scala现有的类型系统,我们免费获得效果子类型和效果多态性。
更新日期:2020-03-31
down
wechat
bug