|
ABSTRACT
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.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
 |
Blo89
|
|
| |
BW85
|
M. Barr and C. Wells, Toposes, Triples, and Theories. Springer Verlag, 1985.
|
| |
BW88
|
|
| |
Fai87
|
|
| |
FL89
|
|
| |
Gog88
|
J.A. Goguen, Higher order functions considered unnecessary for higher order programming. Technical report SRI-CSL-88-1, SRI International, January 1988.
|
 |
GL88
|
|
| |
GH90
|
J. Guzm~n and P. Hudak, Single-threaded polymorphic lambda calculus. In {EEE Symposium on Logic in Computer Science, Philadelphia, June 1990.
|
| |
GMW79
|
M. Gordon, R. Milner, and C. Wadsworth, Edinburgh LCF. LNCS 78, Springer-Verlag, 1979.
|
| |
Hol83
|
S. HolmstrSm, A simple and emcient way to handle large data structures in applicative languges. In Proceedings $ERC/Chalmers Workshop on Declarative Programming, University College London, 1983.
|
 |
Hud86a
|
|
| |
HMT88
|
|
| |
Hud86b
|
Paul Hudak, Arrays, non-determinism, side-effects, and parallelism: A functional perspective, Proc. of a workshop on Graph reduction, p.312-327, September 1987, Santa Fe, New Mexico, United States
|
| |
Hug89
|
|
| |
HO89
|
|
| |
HW90
|
P. Hudak and P. Wadler, editors, Report on ~he Programming Language Haskell. Technical report, Yale University and Glasgow University, April 1990.
|
| |
LS86
|
|
| |
Mac71
|
S. Mac Lane, Categories for the Working Mathematician, Springer-Verlag, 1971.
|
 |
Mil84
|
|
| |
MT89
|
I. Mason and C. Talcott, Axiomatising operational equivalence in the presence of side effects. In IEEE Symposium on Logic in Computer Science, Asilomar, California, june 1989.
|
| |
Mog89a
|
|
| |
Mog89b
|
E. Moggi, An abstract view of programming languges. Course notes, University of Edinburgh.
|
 |
RC86
|
|
| |
Rey74
|
|
| |
Rey83
|
J.C. Reynolds, Types, abstraction, and parametric polymorphism. In R. E. A. Mason, editor, Information Processing 83, 513-523, North-Holland, Amsterdam.
|
 |
Sch85
|
|
| |
Spi89
|
M. Spivey, Term rewriting without exceptions, Science of Computer Programming, 1989.
|
| |
Tur82
|
D.A. Turner, Recursion equations as a programming language. In J. Darlington, P. Henderson, and D. A. Turner, editors, Functional Programming and its Applications, Cambridge University Press, 1982.
|
| |
Tur85
|
|
| |
Wad85
|
|
| |
Wad87
|
P. Wadler, List comprehensions. In S. L. Peyton Jones, The lmplementalion of Functional Programming Languages, Prentice Hall, 1987.
|
 |
Wad89
|
|
| |
Wad90
|
P. Wadler, Linear types can change the world! In IFIP Working Conference on Programming Concepts and Methods, Sea of Gallilee, Israel, April 1990.
|
CITED BY 84
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thomas Cleenewerck , Jacques Noyé , Johan Fabry , Anne-Françoise Lemeur , Éric Tanter, Summary of the third workshop on Domain-Specific Aspect Languages, Proceedings of the 2008 AOSD workshop on Domain-specific aspect languages, p.1-5, April 01-01, 2008, Brussels, Belgium
|
|
|
|
|
|
|
|
|
|
|
|
Martin Odersky , Dan Rabin , Paul Hudak, Call by name, assignment, and the lambda calculus, Proceedings of the 20th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.43-56, March 1993, Charleston, South Carolina, United States
|
|
|
|
|
|
|
|
Douglas Stott Parker, Jr. , Eric Simon , Patrick Valduriez, SVP: A Model Capturing Sets, Lists, Streams, and Parallelism, Proceedings of the 18th International Conference on Very Large Data Bases, p.115-126, August 23-27, 1992
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sheng Liang , Paul Hudak , Mark Jones, Monad transformers and modular interpreters, Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.333-343, January 23-25, 1995, San Francisco, California, United States
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tyng-Ruey Chuang , Benjamin Goldberg, Real-time deques, multihead Turing machines, and purely functional programming, Proceedings of the conference on Functional programming languages and computer architecture, p.289-298, June 09-11, 1993, Copenhagen, Denmark
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Greg Morrisett , David Walker , Karl Crary , Neal Glew, From system F to typed assembly language, Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.85-97, January 19-21, 1998, San Diego, California, United States
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Paul Hudak , John Hughes , Simon Peyton Jones , Philip Wadler, A history of Haskell: being lazy with class, Proceedings of the third ACM SIGPLAN conference on History of programming languages, p.12-1-12-55, June 09-10, 2007, San Diego, California
|
|