Scala Effekt is a library implementation of effect handlers for Scala. It is the first implementation of effect handlers deliberately combining effect handlers with object-oriented features.
Scala already offers many features for modularization, such as mixin composition, higher kinded polymorphism and path dependent types. The combination with effect handlers opens up many new opportunities to structure both, programs using effects, and effect handlers themselves. In particular, Scala Effekt solves the effect expression problem, that is, allowing to add new handler implementations and new effect operations to an effect signature in a modular way.
The design of Scala Effekt makes great use of capability passing. In particular capabilities encapsulate three important aspects of effect handlers:
- they contain the handler implementation (shallow embedding of handlers)
- they contain a prompt marker (to allow capturing the delimited continuation)
- they represent the fact that the user code is allowed to use the effect (as an effect typing discipline)
Effekt: Type- and Effect-safe, Extensible Effect Handlers in Scala
by Jonathan Immanuel Brachthäuser, Philipp Schuster, and Klaus Ostermann
Unpublished. Under consideration for publication in Journal of Functional Programming, 2019.Learn More
Towards Naturalistic EDSLs using Algebraic Effects
by Jonathan Immanuel Brachthäuser
In Workshop for Domain Specific Languages, Design and Implementation (DSLDI), 2017.Learn More