This paper explores the use monads to structure functional programs. No prior knowledge of monads or category theory is required. Monads increase the ease with which programs may be modified. They can mimic the effect of impure features such as exceptions, state, and continuations; and also provide effects not easily achieved with such features. The types of a program reflect which effects occur. The first section is an extended example of the use of monads. A simple interpreter is modified to support various extra features: error messages, state, output, and non-deterministic choice. The second section describes the relation between monads and continuation-passing style. The third section sketches how monads are used in a compiler for Haskell that is written in Haskell.
|
3853
|
Design Patterns: Elements of Reusable Object-Oriented Software
– Gamma, Helm, et al.
- 1995
|
|
1415
|
The Definition of Standard ML
– Milner, Tofte, et al.
- 1990
|
|
522
|
Categories for the working mathematician
– Lane
- 1998
|
|
385
|
Comprehending monads
– WADLER
- 1992
|
|
345
|
Computational lambda-calculus and monads
– Moggi
- 1989
|
|
338
|
ML for the Working Programmer
– Paulson
- 1991
|
|
325
|
Introduction to Higher Order Categorical Logic
– Lambek, Scott
- 1986
|
|
293
|
Pizza into Java: Translating theory into practice
– Odersky, Wadler
- 1997
|
|
225
|
Call-by-name, call-by-value, and the -calculus
– Plotkin
- 1975
|
|
224
|
Definitional interpreters for higher-order programming languages
– Reynolds
- 1972
|
|
131
|
The essence of Algol
– Reynolds
- 1981
|
|
119
|
Abstract Interpretation of Declarative Languages
– Abramsky, Hankin
- 1987
|
|
101
|
Continuation-passing, closure-passing style
– Appel, Jim
- 1989
|
|
101
|
Algebraic reconstruction of types and effects
– JOUVELOT, GIFFORD
- 1991
|
|
90
|
Preliminary design of the programming language Forsythe
– Reynolds
- 1988
|
|
86
|
An Overview of Miranda
– Turner
- 1986
|
|
83
|
Typing first-class continuations in ML
– Duba, Harper, et al.
- 1991
|
|
77
|
to replace failure by a list of successes
– Wadler
- 1985
|
|
68
|
Single-threaded polymorphic lambda calculus
– Guzm'an, Hudak
- 1990
|
|
63
|
editors). Report on the Programming Language Haskell, A Non-strict Purely Functional Language (Version 1.2
– Hudak, Jones, et al.
- 1992
|
|
61
|
Abstracting control
– Danvy, Filinski
- 1990
|
|
54
|
Integrating functional and imperative programming
– Gifford, Lucassen
- 1986
|
|
54
|
Detecting global variables in denotational specifications
– Schmidt
- 1985
|
|
51
|
Using category theory to design implicit conversions and generic operators
– Reynolds
- 1980
|
|
45
|
The essence of functional programming (invited talk
– Wadler
- 1992
|
|
38
|
A functional theory of exceptions
– Spivey
- 1990
|
|
34
|
the ultimate imperative
– Sussman, Lambda
- 1976
|
|
32
|
Assignments for applicative languages
– Swarup, Reddy, et al.
- 1991
|
|
29
|
Update analysis and the efficient implementation of functional aggregates
– Bloss
- 1989
|
|
27
|
and Yannis Smaragdakis. Functional programming in C
– McNamara
- 2000
|
|
24
|
A framework for higher-order functions in C
– Läufer
- 1995
|
|
21
|
The coherrence of languages with intersection types
– Reynolds
- 1991
|
|
21
|
A semantic model of reference counting and its abstraction (detailed summary
– Hudak
- 1986
|
|
16
|
Continuation-based mutable abstract data types, or how to have your state and munge it too
– Hudak
- 1992
|
|
11
|
Syntactic control of interference, part II
– Reynolds
- 1989
|
|
8
|
FACT! – the functional side of C++. http://www.fz-juelich.de/zam/FACT
– Striegnitz
- 2003
|
|
7
|
a continuation extension for
– Perry, HopeC
- 1987
|
|
3
|
An abstract view of programming languges. Course notes
– Moggi
|
|
1
|
Bridging Functional and Object-Oriented Programming” Georgia Tech CoC
– Smaragdakis, McNamara
|
|
1
|
A type checker. Chapter 9 of Simon Peyton Jones, The Implementation of Functional Programming Languages
– Hancock
- 1987
|
|
1
|
there a use for linear logic
– Is
- 1991
|