Effect handlers in scope

Nicolas Wu, Tom Schrijvers, Ralf Hinze
2014 Proceedings of the 2014 ACM SIGPLAN symposium on Haskell - Haskell '14  
Algebraic effect handlers are a powerful means for describing effectful computations. They provide a lightweight and orthogonal technique to define and compose the syntax and semantics of different effects. The semantics is captured by handlers, which are functions that transform syntax trees. Unfortunately, the approach does not support syntax for scoping constructs, which arise in a number of scenarios. While handlers can be used to provide a limited form of scope, we demonstrate that this
more » ... roach constrains the possible interactions of effects and rules out some desired semantics. This paper presents two different ways to capture scoped constructs in syntax, and shows how to achieve different semantics by reordering handlers. The first approach expresses scopes using the existing algebraic handlers framework, but has some limitations. The problem is fully solved in the second approach where we introduce higher-order syntax.
doi:10.1145/2633357.2633358 dblp:conf/haskell/WuSH14 fatcat:eialadszfbf5fcvndcmrdhilmi