Monads and Modularity
- 196 Downloads
This paper argues that the core of modularity problems is an understanding of how individual components of a large system interact with each other, and that this interaction can be described by a layer structure. We propose a uniform treatment of layers based upon the concept of a monad. The combination of different systems can be described by the coproduct of monads.
Concretely, we give a construction of the coproduct of two monads and show how the layer structure in the coproduct monad can be used to analyse layer structures in three different application areas, namely term rewriting, denotational semantics and functional programming.
KeywordsNatural Transformation Algebraic Theory Free Algebra Functional Programming Left Adjoint
Unable to display preview. Download preview PDF.
- 1.Haskell 98: A non-strict, purely functional language. Available at http://www.haskell.org, January 1999.
- 2.J. Adamek and J. Rosický. Locally Presentable and Accessible Categories. LMS Lecture Notes 189, Cambridge University Press, 1994.Google Scholar
- 4.M. Fiore, G. Plotkin, and D. Turi. Abstract syntax and variable binding. In Proc. LICS’99, pages 193–202. IEEE Computer Society Press, 1999.Google Scholar
- 5.N. Ghani, C. Lüth, F. de Marchi, and J. Power. Algebras, coalgebras, monads and comonads. Proc. CMCS’01, ENTCS 44:1, 2001.Google Scholar
- 6.M. Jones and L. Duponcheel. Composing monads. Technical Report YALEU/DCS/RR-1004, Yale University, Dept. Comp. Sci, Dec 1993.Google Scholar
- 8.D. King and P. Wadler. Combining monads. In J. Launchbury and P.M. Samson, eds., Functional Programming, Workshops in Computing, 1993.Google Scholar
- 9.S. Liang, P. Hudak, and M. Jones. Monad transformers and modular interpreters. In Proc. of the 22nd ACM Symposium on Principles of Programming Languages. ACM Press, Jan 1995.Google Scholar
- 10.C. Lüth. Categorical Term Rewriting: Monads and Modularity. PhD thesis, University of Edinburgh, 1998.Google Scholar
- 11.C. Lüth and N. Ghani. Monads and modular term rewriting. In CTCS’97, LNAI 1290, pages 69–86. Springer, Sep 1997.Google Scholar
- 12.S. Mac Lane. Categories for the Working Mathematician, Graduate Texts in Mathematics 5. Springer, 1971.Google Scholar
- 13.E. Moggi. Computational lambda-calculus and monads. In Proc. LICS’89. IEEE, Computer Society Press, June 1989.Google Scholar
- 14.E. Moggi. An abstract view of programming languages. Technical Report ECSLFCS-90-113, LFCS, 1990.Google Scholar
- 16.D. T. Sannella and R. M. Burstall. Structured theories in LCF. In 8 th Colloquium on Trees in Algebra and Programming, LNAI 159, pages 377–391. Springer, 1983.Google Scholar