当前位置: 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.)
Doo bee doo bee doo
Journal of Functional Programming ( IF 1.1 ) Pub Date : 2020-03-31 , DOI: 10.1017/s0956796820000039
LUKAS CONVENT , SAM LINDLEY , CONOR MCBRIDE , CRAIG MCLAUGHLIN

We explore the design and implementation of Frank, a strict functional programming language with a bidirectional effect type system designed from the ground up around a novel variant of Plotkin and Pretnar’s effect handler abstraction. Effect handlers provide an abstraction for modular effectful programming: a handler acts as an interpreter for a collection of commands whose interfaces are statically tracked by the type system. However, Frank eliminates the need for an additional effect handling construct by generalising the basic mechanism of functional abstraction itself. A function is but the special case of a Frankoperatorthat interprets no commands. Moreover, Frank’s operators can bemultihandlerswhich simultaneously interpret commands from several sources at once, without disturbing the direct style of functional programming with values. Effect typing in Frank employs a novel form of effect polymorphism which avoids mentioning effect variables in source code. This is achieved by propagating anambient abilityinwards, rather than accumulating unions of potential effects outwards. With the ambient ability describing the effects that are available at a certain point in the code, it can become necessary to reconfigure access to the ambient ability. A primary goal is to be able to encapsulate internal effects, eliminating a phenomenon we calleffect pollution. Moreover, it is sometimes desirable to rewire the effect flow between effectful library components. We propose adaptors as a means for supporting both effect encapsulation and more general rewiring. Programming with effects and handlers is in its infancy. We contribute an exploration of future possibilities, particularly in combination with other forms of rich type systems.

中文翻译:

嘟嘟嘟嘟嘟嘟

我们探索了 Frank 的设计和实现,这是一种严格的函数式编程语言,具有双向效果类型系统,从头开始围绕 Plotkin 和 Pretnar 的效果处理程序抽象的新变体设计。效果处理程序为模块化有效编程提供了一种抽象:处理程序充当一组命令的解释器,这些命令的接口由类型系统静态跟踪。然而,弗兰克通过概括功能抽象本身的基本机制消除了对额外效果处理结构的需要。函数只是 Frank 的特例操作员不解释任何命令。此外,弗兰克的算子可以是多处理器它一次同时解释来自多个来源的命令,而不会干扰具有值的函数式编程的直接风格。Frank 中的效果类型采用了一种新颖的效果多态性形式,它避免在源代码中提及效果变量。这是通过传播一个环境能力向内,而不是向外累积潜在影响的联合。由于环境能力描述了代码中某个点可用的效果,因此有必要重新配置对环境能力的访问。一个主要目标是能够封装内部效应,消除我们称之为的现象影响污染. 此外,有时需要重新连接有效库组件之间的效果流。我们建议将适配器作为支持效果封装和更一般的重新布线的一种手段。使用效果和处理程序进行编程还处于起步阶段。我们贡献了对未来可能性的探索,特别是与其他形式的富类型系统相结合。
更新日期:2020-03-31
down
wechat
bug