Monad transformers and modular algebraic effects: what binds them together
with Tom Schrijvers, Maciej Pirog, and Nicolas Wu . Haskell 2019. PDF
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.
BibTeX
@inproceedings{SPWJ2019,
author = {Schrijvers, Tom and Pir\'{o}g, Maciej and Wu, Nicolas and Jaskelioff, Mauro},
title = {Monad Transformers and Modular Algebraic Effects: What Binds Them Together},
booktitle = {Proceedings of the 12th ACM SIGPLAN International Symposium on Haskell},
series = {Haskell 2019},
year = {2019},
isbn = {978-1-4503-6813-1},
location = {Berlin, Germany},
pages = {98--113},
numpages = {16},
url = {http://doi.acm.org/10.1145/3331545.3342595},
doi = {10.1145/3331545.3342595},
acmid = {3342595},
publisher = {ACM},
address = {New York, NY, USA},
keywords = {Effects, Handlers, Monads, Transformers},
}