Handlers of Algebraic Effects
We present an algebraic treatment of exception handlers and, more generally, introduce handlers for other computational effects representable by an algebraic theory. These include nondeterminism, interactive input/output, concurrency, state, time, and their combinations; in all cases the computation monad is the free-model monad of the theory. Each such handler corresponds to a model of the theory for the effects at hand. The handling construct, which applies a handler to a computation, is based on the one introduced by Benton and Kennedy, and is interpreted using the homomorphism induced by the universal property of the free model. This general construct can be used to describe previously unrelated concepts from both theory and practice.
- 4.Enderton, H.B.: A Mathematical Introduction to Logic, 2nd edn. Academic Press, London (2000)Google Scholar
- 5.Filinski, A.: Representing layered monads. In: 26th Symposium on Principles of Programming Languages, pp. 175–188 (1999)Google Scholar
- 6.Flanagan, C., Sabry, A., Duba, B.F., Felleisen, M.: The essence of compiling with continuations. In: PLDI, pp. 237–247 (1993)Google Scholar
- 14.Moggi, E.: Computational lambda-calculus and monads. In: 4th Symposium on Logic in Computer Science, pp. 14–23 (1989)Google Scholar
- 16.Peyton Jones, S.L.: Haskell 98. Journal of Functional Programming 13(1), 255 (2003)Google Scholar
- 22.Plotkin, G.D., Pretnar, M.: A logic for algebraic effects. In: 23rd Symposium on Logic in Computer Science, pp. 118–129 (2008)Google Scholar