## The Marriage of Effects and Monads (1998)

### Cached

### Download Links

- [www.research.avayalabs.com]
- [homepages.inf.ed.ac.uk]
- [www.research.avayalabs.com]
- DBLP

### Other Repositories/Bibliography

Citations: | 97 - 5 self |

### BibTeX

@MISC{Wadler98themarriage,

author = {Philip Wadler and Peter Thiemann},

title = {The Marriage of Effects and Monads},

year = {1998}

}

### Years of Citing Articles

### OpenURL

### Abstract

this paper is to marry effects to monads, writing T for a computation that yields a value in and may have effects delimited by oe. Now we have that ( is

### Citations

1614 | The Definition of Standard ML
- MILNER, TOFTE, et al.
- 1990
(Show Context)
Citation Context ...much effort. Value polymorphism Some care is required when mixing computational effects with polymorphic types, lest soundness be forfeit. One approach, due Tofte [Tof87] and used in the original SML =-=[MTH90]-=-, introduces `imperative ' type variables in the presence of computational effects. Numerous other approaches have been broached, including some based on effects [Wri92, TJ94]. However, by far the sim... |

1344 | Introduction to Functional Programming
- Bird, Wadler
(Show Context)
Citation Context ...IO is used to represent all computational effects that perform input/output [PW93, PH97]. In the Glasgow and Chalmers dialects of Haskell, this includes calls of procedures written in other languages =-=[PW93]-=-. Again, all effects are lumped into a single monad, and again a variant of the system described here could be used to augment the IO monad with effects. Monads labeled with effects can also be applie... |

974 | A theory of type polymorphism in programming
- Milner
- 1978
(Show Context)
Citation Context ...ion, and effect reconstruction algorithms for the two languages. The reconstruction algorithm for Effect, due to Talpin and Jouvelot, closely resembles Milner's original type reconstruction algorithm =-=[Mil78]-=-. Effects are handled by accumulating a set of constraints, similar to the handling of subtypes in Mitchell's inference algorithm [Mit91]. It is straightforward to transpose the reconstruction algorit... |

759 | Notions of computation and monads - Moggi - 1991 |

564 | A syntactic approach to type soundness
- Wright, Felleisen
- 1994
(Show Context)
Citation Context ... and Jouvelot is that they follow the classic work of Tofte [Tof87] and use an operational semantics based on normalistation (`big step'), while we follow the updated approach of Wright and Felleisen =-=[WF94]-=- and use an operational semantics based on reduction (`small step'). As noted by Wright and Felleisen, this leads to a simpler proof: instead of a complex relation between values and types (specified ... |

467 | Comprehending Monads - Wadler - 1990 |

454 | Computational lambda-calculus and monads - Moggi - 1989 |

340 |
Foundations for Programming Languages
- Mitchell
- 1996
(Show Context)
Citation Context ...s(ilet). Following Talpin and Jouvelot, we use substition rather than type schemes to indicate polymorphism. The equivalence of the two forms of specification is well known (e.g., see Mitchell's text =-=[Mit96]-=-). The notation e[v=x] stands for the substitution of value v for identifier x in expression e, with renaming to avoid capture of bound identifiers. Of course, actually performing the substitution is ... |

251 | Polymorphic effect systems
- Lucassen, Gifford
- 1988
(Show Context)
Citation Context ...is problem, and the monad-based system described here could be applied directly to augment the ST monad with effects. In fact, the letregion construct [TT94, TB98] (which was originally named private =-=[LG88]-=-) corresponds closely to the runST operator in Glasgow Haskell. This connection can be formalized and proved correct for a simple call-by-value language with runST [SS99]. Similarly, in Haskell the mo... |

221 | Call-by-name, call-by-value and the ‚-calculus - PLOTKIN - 1975 |

211 | Concurrent Haskell
- Jones, Gordon, et al.
- 1996
(Show Context)
Citation Context ...used to represent all computational effects that perform input/output [PW93, PH97]. Dialects of Haskell extend this to call procedures written in other languages [PW93, FLMP99], deal with concurrency =-=[PGF96]-=-, or handle exceptions [PRH + 99]. Again, all effects are lumped into a single monad, and again a variant of the system described here could be used to augment the IO monad with effects. Monads labele... |

156 | The type and effect discipline
- Talpin, Jouvelot
- 1992
(Show Context)
Citation Context ... a straightforward way to a monad formulation. It seems clear that other effect systems can be transposed to monads in a similar way. For instance, Talpin and Jouvelot later proposed a variant system =-=[TJ94]-=-, and Tofte and Bikedal [TB98] propose a system for analysing memory allocation, and it appear either of these might work equally well as a basis for a monad formulation. The system used in [TJ92] all... |

124 | Polymorphic type, region and effect inference
- Talpin, Jouvelot
- 1992
(Show Context)
Citation Context ... effect variables, where each method is labeled with the exceptions it might raise [GJS96]. For concreteness, this paper works with the type, region, and effect system proposed by Talpin and Jouvelot =-=[TJ92]-=-, where effects indicate which regions of store are initialised, read, or written. All of Talpin and Jouvelot's results transpose in a straightforward way to a monad formulation. It seems clear that o... |

111 | Lazy functional state threads - Launchbury, Jones - 1994 |

109 | Compiling Standard ML to Java bytecodes
- BENTON, KENNEDY, et al.
- 1998
(Show Context)
Citation Context ...does not write the store, certain operations may be commuted. This technique has been applied to intermediate languages for Standard ML compilers by Tolmach [Tol98] and by Benton, Kennedy, and Russel =-=[BKR98]-=-. Our work can be regarded as complementary to theirs: we provide the theory and they provide the practice. Summary of results Talpin and Jouvelot present (i) a type system with effects, (ii) a semant... |

98 |
Type inference with simple subtypes
- Mitchell
- 1991
(Show Context)
Citation Context ...sely resembles Milner's original type reconstruction algorithm [Mil78]. Effects are handled by accumulating a set of constraints, similar to the handling of subtypes in Mitchell's inference algorithm =-=[Mit91]-=-. It is straightforward to transpose the reconstruction algorithm from Effect to Monad. Both algorithms are sound and complete, and typings yielded by the two algorithms are related by the translation... |

97 | Simple imperative polymorphism
- Wright
- 1995
(Show Context)
Citation Context ...erous other approaches have been broached, including some based on effects [Wri92, TJ94]. However, by far the simplest is value polymorphism. This approach, noted by Tofte [Tof87], promoted by Wright =-=[Wri95]-=-, and used in the revised SML [MTHM97], restricts polymorphism to values, a subclass of expressions that can have no computational effects. Talpin and Jouvelot [TJ92] used value polymorphism, and we d... |

94 | Operational Semantics and Polymorphic Type Inference
- Tofte
- 1988
(Show Context)
Citation Context ...ion and formulation of Talpin and Jouvelot [TJ92]. (Along the way, we correct a few infelicities in their paper.) One difference from Talpin and Jouvelot is that they follow the classic work of Tofte =-=[Tof87]-=- and use an operational semantics based on normalistation (`big step'), while we follow the updated approach of Wright and Felleisen [WF94] and use an operational semantics based on reduction (`small ... |

88 | Integrating functional and imperative programming - Giord, Lucassen - 1986 |

87 | A generic account of continuationpassing styles
- Hatcliff, Danvy
- 1994
(Show Context)
Citation Context ...the existing type relation (specified by structural induction). The monad translation we use is standard. It was introduced by Moggi [Mog89, Mog91], and has been further studied by Hatcliff and Danvy =-=[HD94]-=- and Sabry and Wadler [SW97]. Our reduction semantics for the monad is new. It most closely resembles the work of Hatcliff and Danvy, but they did not deal with state and therefore failed to distingui... |

74 | A region inference algorithm
- Tofte, Birkedal
- 1998
(Show Context)
Citation Context ...nad formulation. It seems clear that other effect systems can be transposed to monads in a similar way. For instance, Talpin and Jouvelot later proposed a variant system [TJ94], and Tofte and Bikedal =-=[TB98]-=- propose a system for analysing memory allocation, and it appear either of these might work equally well as a basis for a monad formulation. The system used in [TJ92] allows many effect variables to a... |

73 | Functional Programming with Overloading and HigherOrder Polymorphism - Jones - 1995 |

60 | P.: A reflection on call-by-value
- Sabry, Wadler
- 1997
(Show Context)
Citation Context ...specified by structural induction). The monad translation we use is standard. It was introduced by Moggi [Mog89, Mog91], and has been further studied by Hatcliff and Danvy [HD94] and Sabry and Wadler =-=[SW96]-=-. Our reduction semantics for the monad is new. It most closely resembles the work of Hatcliff and Danvy, but they did not deal with state and therefore failed to distinguish between pure reductions a... |

58 | Types and effects, towards an integration of functional and imperative programming - Lucassen - 1987 |

57 | Calling hell from heaven and heaven from hell - Finne, Leijen, et al. - 1999 |

56 | Representing layered monads
- Filinski
(Show Context)
Citation Context ...s in a similar way. For instance, Tofte, Talpin, and Birkedal [TT94, TB98] propose a system for analysing memory allocation, which might work equally well as a basis for a monad formulation. Filinski =-=[Fil99]-=- shows another connection between monads and effects. In his approach, there is a language with multiple layers of effects. The semantics of this language is defined by consecutive monad translations,... |

55 |
The essence of functional programming (Invited talk), in
- Wadler
- 1992
(Show Context)
Citation Context ...te the following: . . . the use of monads is similar to the use of effect systems . . . . An intriguing question is whether a similar form of type inference could apply to a language based on monads. =-=[Wad92]-=- Half a decade later, I can answer that question in the affirmative. Goodness knows why it took so long, because the correspondence between effects and monads turns out to be surprisingly close. The m... |

54 | A semantics for imprecise exceptions - Jones, Reid, et al. - 1999 |

52 |
Implementation of the typed call-by-value -calculus using a stack of regions
- Tofte, Talpin
- 1994
(Show Context)
Citation Context ... the case of polymorphic `let' binding, assuming such bindings have been expanded out.) Another way to obtain a completeness result would be to introduce arrow effects as proposed by Tofte and others =-=[TT94]-=-. In fact, type schemes with arrow effects are equivalent to the reconstruction type schemes introduced in the present section: simply replace each arrow effect ffl:OE by the effect variable ffl and a... |

39 |
Fx-87 reference manual
- Giord, Jouvelot, et al.
- 1987
(Show Context)
Citation Context ...ng others, and the use of monads, proposed by Moggi [Mog89, Mog91], and pursued by myself [Wad90, Wad92, Wad93, Wad95] among others. Effect systems are typically found in strict languages, such as FX =-=[GJLS87]-=- (a variant of Lisp), while monads are typically found in lazy languages, such as Haskell [PH97]. In my pursuit of monads, I wrote the following: . . . the use of monads is similar to the use of effec... |

36 | Polymorphic Type Assignment and CPS Conversion
- Harper, Lillibridge
- 1993
(Show Context)
Citation Context ...s are absent. In retrospect, the extension seems obvious, since the monad translation handles values specially. Indeed, similar uses of value polymorphism have been proposed by Harper and Lillibridge =-=[HL93]-=- (for CPS with call/cc) and by Barthe, Hatcliff, and Thiemann [BHT98] (for a version of the monadic metalanguage with a configurable type system, in the manner of Pure Type Systems). One might say tha... |

34 |
Inheritance and explicit coercion
- Breazu-Tannen, Coquand, et al.
- 1989
(Show Context)
Citation Context ...at init(ae) or write(ae) is in oe. Corresponding to each effect inclusion oe ` oe 0 there should be a monad morphism T oe ! T oe 0 . In order to ensure coherence in the style of Breazau-Tannen et al. =-=[BCGS91]-=-, we should expect transitivity of inclusions to correspond to composition of the corresponding morphisms. A general theory of effects and monads As hypothesised by Moggi and as born out by practice, ... |

31 | Polymorphism by name for references and continuations
- Leroy
- 1993
(Show Context)
Citation Context ...us other approaches have been suggested, including some based on effects [Wri92, TJ94]. However, by far the simplest is value polymorphism. This approach was noted by Tofte [Tof87], promoted by Leroy =-=[Ler93]-=- and Wright [Wri95], and used in the revised SML [MTHM97]. It restricts polymorphism to values, a subclass of expressions that can have no computational effects. Talpin and Jouvelot [TJ92] used value ... |

28 | Monadic encapsulation of effects: a revised approach (extended version - Moggi, Sabry |

27 | Typing references by effect inference - Wright - 1992 |

25 | Reasoning about Continuations with Control E ects - Jouvelot, ord, et al. - 1989 |

14 | Optimizing ML using a hierarchy of monadic types
- Tolmach
- 1998
(Show Context)
Citation Context ...ay be applied. Or when the monad reads but does not write the store, certain operations may be commuted. This technique has been applied to intermediate languages for Standard ML compilers by Tolmach =-=[Tol98]-=- and by Benton, Kennedy, and Russel [BKR98]. Our work can be regarded as complementary to theirs: we provide the theory and they provide the practice. Summary of results Talpin and Jouvelot present (i... |

12 | Theoretical and Practical Aspects of Type and Effect Inference - Talpin - 1993 |

8 | P.: Monadic type systems: Pure type systems for impure settings (preliminary report
- Barthe, Hatcliff, et al.
- 1997
(Show Context)
Citation Context ...monad translation handles values specially. Indeed, similar uses of value polymorphism have been proposed by Harper and Lillibridge [HL93] (for CPS with call/cc) and by Barthe, Hatcliff, and Thiemann =-=[BHT98]-=- (for a version of the monadic metalanguage with a configurable type system, in the manner of Pure Type Systems). One might say that value polymorphism fits monads to a `T'. Outline The remainder of t... |

7 |
Haskell 1.4, a non-strict, purely functional language
- Peterson, Hammond
- 1997
(Show Context)
Citation Context ...Wad92, Wad93, Wad95] among others. Effect systems are typically found in strict languages, such as FX [GJLS87] (a variant of Lisp), while monads are typically found in lazy languages, such as Haskell =-=[PH97]-=-. In my pursuit of monads, I wrote the following: . . . the use of monads is similar to the use of effect systems . . . . An intriguing question is whether a similar form of type inference could apply... |

6 | How to declare an imperative (invited talk - Wadler - 1995 |

4 |
Monadic Encapsulation
- Semmelroth, Sabry
- 1999
(Show Context)
Citation Context ... was originally named private [LG88]) corresponds closely to the runST operator in Glasgow Haskell. This connection can be formalized and proved correct for a simple call-by-value language with runST =-=[SS99]-=-. Similarly, in Haskell the monad IO is used to represent all computational effects that perform input/output [PW93, PH97]. Dialects of Haskell extend this to call procedures written in other language... |

3 |
a non-strict, purely functional language. http://www.haskell.org
- Haskell98
- 1998
(Show Context)
Citation Context ...Wad92, Wad93, Wad95] among others. Effect systems are typically found in strict languages, such as FX [GJLS87] (a variant of Lisp), while monads are typically found in lazy languages, such as Haskell =-=[Has98]-=-. In his pursuit of monads, Wadler wrote the following: . . . the use of monads is similar to the use of effect systems . . . . An intriguing question is whether a similar form of type inference could... |

2 | Hanne Riis Nielson, Flemming Nielson, and Torben Amtoft. Polymorphic subtyping for effect analysis: The static semantics - Wadler, Thiemann - 1997 |

1 |
Optimizing ML using a hierarchy of monadic yypes
- Tolmach
- 1998
(Show Context)
Citation Context ...ay be applied. Or when the monad reads but does not write the store, certain operations may be commuted. This technique has been applied to intermediate languages for Standard ML compilers by Tolmach =-=[Tol98]-=- and by Benton, Kennedy, and Russel [BKR98]. Our work can be regarded as complementary to theirs: we provide the theory and they provide the practice. Summary of results Talpin and Jouvelot present (i... |

1 | Torben Amtoft. Polymorphic subtyping for effect analysis: The static semantics - Henderson - 1997 |

1 |
A reflection on callby -value
- Sabry, Wadler
- 1997
(Show Context)
Citation Context ...specified by structural induction). The monad translation we use is standard. It was introduced by Moggi [Mog89, Mog91], and has been further studied by Hatcliff and Danvy [HD94] and Sabry and Wadler =-=[SW97]-=-. Our reduction semantics for the monad is new. It most closely resembles the work of Hatcliff and Danvy, but they did not deal with state and therefore failed to distinguish between pure reductions a... |