Download PDF

ACM SIGPLAN Haskell Symposium, Date: 2019/08/22 - 2019/08/23, Location: Berlin, Germany

Publication date: 2019-08-22
Pages: 98 - 113
ISSN: 0362-1340
Publisher: Association for Computing Machinery

Proceedings of the 12th ACM SIGPLAN International Symposium on Haskell (Haskell 2019)

Author:

Schrijvers, Tom
Pirog, Maciej ; Wu, Nicolas ; Jaskelioff, Mauro ; Eisenberg, RA

Keywords:

Science & Technology, Technology, Computer Science, Software Engineering, Computer Science, Handlers, Effects, Monads, Transformers, HANDLERS, Software Engineering

Abstract:

For over two decades, monad transformers have been the main modular approach for expressing purely functional side-effects in Haskell. Yet, in recent years algebraic effects have emerged as an alternative whose popularity is growing. While the two approaches have been well-studied, there is still confusion about their relative merits and expressiveness, especially when it comes to their comparative modularity. This paper clarifies the connection between the two approaches---some of which is folklore---and spells out consequences that we believe should be better known. We characterise a class of algebraic effects that is modular, and show how these correspond to a specific class of monad transformers. In particular, we show that our modular algebraic effects gives rise to monad transformers. Moreover, every monad transformer for algebraic operations gives rise to a modular effect handler.