Skip to main content
    • Aa
    • Aa

Comprehending monads

  • Philip Wadler (a1)

Category theorists invented monads in the 1960's to express concisely certain aspects of universal algebra. Functional programmers invented list comprehensions in the 1970's to express concisely certain programs involving lists. This paper shows how list comprehensions may be generalised to an arbitrary monad, and how the resulting programming feature can express concisely in a pure functional language some programs that manipulate state, handle exceptions, parse text, or invoke continuations. A new solution to the old problem of destructive array update is also presented. No knowledge of category theory is assumed.

Linked references
Hide All

This list contains references from the content that can be linked to their source. For a full set of references and notes please see the PDF or HTML where available.

M. Barr and C. Wells (1985) Toposes, Triples, and Theories. Springer Verlag.

J. Fairbairn (1987) Form follows function. Software — Practice and Experience, 17(6) 379386.

M. Gordon R. Milner and C. Wadsworth (1979) Ediburgh LCF. LNCS 78, Springer-Verlag.

J. Hughes (1989) Why functional programming matters. The Computer Journal, 32(2) 98107.

S. Mac Lane (1971) Categories for the Working Mathematician. Springer-Verlag.

G. Plotkin (1975) Call-by-name, call-by-value, and the λ-calculus. Theoretical Computer Science, 1 125159.

J. Rees and W. Clinger , editors, (1986) The revised3 report on the algorithmic language Scheme. ACM SIGPLAn Notices, 21(12) 3779.

D. A. Schmidt (1985) Detecting global variables in denotational specifications. ACM Transactions on Programming Languages and Systems, 7 299310.

M. Spivey (1990) A functional theory of exceptions. Science of Computer Programming. 14(1) 2542.

D. A. Turner (1985) Miranda: A non-strict functional language with polymorphic types. In: Proceedings of the 2nd International Conference on Functional Programming Languages and Computer Architecture, Nancy, France, LNCS 201, Springer Verlag.

P. Wadler (1985) How to replace failure by a list of successes. In: 2nd Symposium on Functional Programming Languages and Computer Architecture, Nancy, LNCS 273, Springer-Verlag.

Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Mathematical Structures in Computer Science
  • ISSN: 0960-1295
  • EISSN: 1469-8072
  • URL: /core/journals/mathematical-structures-in-computer-science
Please enter your name
Please enter a valid email address
Who would you like to send this to? *


Full text views

Total number of HTML views: 0
Total number of PDF views: 10 *
Loading metrics...

Abstract views

Total abstract views: 166 *
Loading metrics...

* Views captured on Cambridge Core between September 2016 - 25th June 2017. This data will be updated every 24 hours.