Comprehending monads
Philip L. Wadler · 1990
Category theorists invented monads in the 1960's to concisely express certain aspects of universal algebra. Functional programmers invented list comprehensions in the 1970's to concisely express certain programs involving lists. This paper shows how list comprehensions may be generalised to an arbitrary monad, and how the resulting programming feature can concisely express 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.
Cited by 576 works. doi:10.1145/91556.91592 Open-access PDF
Authors
References
- Categories for the Working Mathematician
- The Definition of Standard ML
- Call-by-name, call-by-value and the λ-calculus
- Edinburgh LCF
- Revised 3 report on the algorithmic language scheme
- Miranda: A non-strict functional language with polymorphic types
- Introduction to functional programming
- Introduction to Higher Order Categorical Logic.
- A proposal for standard ML
- Computational lambda-calculus and monads