Notice

The website of Tom Schrijvers has moved to http://people.cs.kuleuven.be/~tom.schrijvers. Please adjust any links you maintain as this copy will be taken down shortly.


Effect Handlers in Scope


Nicolas Wu and Tom Schrijvers and Ralf Hinze.
Haskell 2014.
2014.

Abstract

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 approach 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.

BibTeX

@inproceedings{haskell2014,
  title = {Effect Handlers in Scope},
  author = {Nicolas Wu and Tom Schrijvers and Ralf Hinze},
  year = {2014},
  booktitle = {Haskell 2014},
  url = {/Research/papers/haskell2014.pdf},
  talk = {/Research/talks/haskell2014.pdf},
  video = {https://www.youtube.com/watch?v=q2TRONftCcg&list=PL4UWOFngo5DXuUiMCNumrFhaDfMx54QgV&index=40},
  abstract = {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
approach 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.
  },
}