Abstract
During the last two decades, monads have become an indispensable tool for structuring functional programs with computational effects. In this setting, the mathematical notion of a monad is extended with operations that allow programmers to manipulate these effects. When several effects are involved, monad transformers can be used to build up the required monad one effect at a time. Although this seems to be modularity nirvana, there is a catch: in addition to the construction of a monad, the effect-manipulating operations need to be lifted to the resulting monad. The traditional approach for lifting operations is non-modular and ad-hoc. We solve this problem with a principled technique for lifting operations that makes monad transformers truly modular.
Chapter PDF
Similar content being viewed by others
References
Barendregt, H.: Lambda calculi with types. In: Abramsky, S., Gabbay, D.M., Maibaum, T.S.E. (eds.) Handbook of Logic in Computer Science, pp. 117–309. Oxford University Press, Oxford (1992)
Barr, M., Wells, C.: Toposes, Triples and Theories. Grundlehren der mathematischen Wissenschaften, vol. 278. Springer, New York (1985)
Benton, N., Hughes, J., Moggi, E.: Monads and effects. In: Barthe, G., Dybjer, P., Pinto, L., Saraiva, J. (eds.) APPSEM 2000. LNCS, vol. 2395, pp. 42–122. Springer, Heidelberg (2002)
Coquand, T., Huet, G.P.: The calculus of constructions. Inf. Comput. 76(2/3), 95–120 (1988)
Ghani, N.: Eta-expansions in F-omega. In: van Dalen, D., Bezem, M. (eds.) CSL 1996. LNCS, vol. 1258, pp. 182–197. Springer, Heidelberg (1997)
Harper, R., Mitchell, J.C., Moggi, E.: Higher-order modules and the phase distinction. In: POPL, pp. 341–354 (1990)
Hyland, M., Plotkin, G.D., Power, J.: Combining effects: Sum and tensor. Theor. Comput. Sci. 357(1-3), 70–99 (2006)
Jaskelioff, M.: Monatron: an extensible monad transformer library (submitted for publication) (2008), http://www.cs.nott.ac.uk/~mjj/pubs/monatron.pdf
Peyton Jones, S.L., Wadler, P.: Imperative functional programming. In: POPL, pp. 71–84 (1993)
Liang, S., Hudak, P., Jones, M.: Monad transformers and modular interpreters. In: POPL, pp. 333–343 (1995)
Lüth, C., Ghani, N.: Composing monads using coproducts. In: ICFP, pp. 133–144 (2002)
Mac Lane, S.: Categories for the Working Mathematician. Graduate Texts in Mathematics, vol. 5. Springer, Heidelberg (1971)
Moggi, E.: Computational lambda-calculus and monads. In: LICS, pp. 14–23. IEEE Computer Society, Los Alamitos (1989)
Moggi, E.: Notions of computation and monads. Information and Computation 93(1), 55–92 (1991)
Moggi, E.: Metalanguages and applications. In: Semantics and Logics of Computation. Publications of the Newton Institute. CUP (1997)
Pierce, B.C.: Basic Category Theory for Computer Scientists (Foundations of Computing). MIT Press, Cambridge (1991)
Plotkin, G.D., Power, J.: Semantics for algebraic operations. In: ENTCS, vol. 45 (2001)
Reynolds, J.C., Plotkin, G.D.: On functors expressible in the polymorphic typed lambda calculus. Inf. Comput. 105(1), 1–29 (1993)
Wadler, P.: Comprehending monads. MSCS 2(4), 461–493 (1992)
Wadler, P.: The essence of functional programming. In: POPL, pp. 1–14 (1992)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Jaskelioff, M. (2009). Modular Monad Transformers. In: Castagna, G. (eds) Programming Languages and Systems. ESOP 2009. Lecture Notes in Computer Science, vol 5502. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-00590-9_6
Download citation
DOI: https://doi.org/10.1007/978-3-642-00590-9_6
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-00589-3
Online ISBN: 978-3-642-00590-9
eBook Packages: Computer ScienceComputer Science (R0)