Abstract
AbstractWe 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.
Publisher
Cambridge University Press (CUP)
Cited by
23 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Fast and Efficient Boolean Unification for Hindley-Milner-Style Type and Effect Systems;Proceedings of the ACM on Programming Languages;2023-10-16
2. A General Fine-Grained Reduction Theory for Effect Handlers;Proceedings of the ACM on Programming Languages;2023-08-30
3. With or Without You: Programming with Effect Exclusion;Proceedings of the ACM on Programming Languages;2023-08-30
4. Live Pattern Matching with Typed Holes;Proceedings of the ACM on Programming Languages;2023-04-06
5. When Programs Have to Watch Paint Dry;Lecture Notes in Computer Science;2023