当前位置: 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.)
Explicit effect subtyping
Journal of Functional Programming ( IF 1.1 ) Pub Date : 2020-06-08 , DOI: 10.1017/s0956796820000131
GEORGIOS KARACHALIAS , MATIJA PRETNAR , AMR HANY SALEH , STIEN VANDERHALLEN , TOM SCHRIJVERS

As popularity of algebraic effects and handlers increases, so does a demand for their efficient execution. Eff, an ML-like language with native support for handlers, has a subtyping-based effect system on which an effect-aware optimising compiler could be built. Unfortunately, in our experience, implementing optimisations for Eff is overly error-prone because its core language is implicitly typed, making code transformations very fragile. To remedy this, we present an explicitly typed polymorphic core calculus for algebraic effect handlers with a subtyping-based type-and-effect system. It reifies appeals to subtyping in explicit casts with coercions that witness the subtyping proof, quickly exposing typing bugs in program transformations. Our typing-directed elaboration comes with a constraint-based inference algorithm that turns an implicitly typed Eff-like language into our calculus. Moreover, all coercions and effect information can be erased in a straightforward way, demonstrating that coercions have no computational content. Additionally, we present a monadic translation from our calculus into a pure language without algebraic effects or handlers, using the effect information to introduce monadic constructs only where necessary.

中文翻译:

显式效果子类型

随着代数效应和处理程序的普及,对其高效执行的需求也在增加。Eff 是一种对处理程序具有原生支持的类 ML 语言,具有基于子类型的效果系统,可以在其上构建效果感知优化编译器。不幸的是,根据我们的经验,为 Eff 实现优化过于容易出错,因为它的核心语言是隐式类型的,这使得代码转换非常脆弱。为了解决这个问题,我们提出了一个显式类型的多态核心演算,用于具有基于子类型的类型和效果系统的代数效果处理程序。它通过见证子类型证明的强制来具体化对显式强制转换中的子类型的吸引力,从而迅速暴露程序转换中的类型错误。我们以类型为导向的详细说明带有基于约束的推理算法,该算法将隐式类型的 Eff 类语言转换为我们的微积分。此外,所有强制和效果信息都可以直接删除,证明强制没有计算内容。此外,我们将单子从我们的微积分翻译成没有代数效应或处理程序的纯语言,仅在必要时使用效应信息来引入单子结构。
更新日期:2020-06-08
down
wechat
bug