## Monadic Encapsulation of Effects: A Revised Approach (Extended Version) (1999)

### Cached

### Download Links

- [www.cs.indiana.edu]
- [www.disi.unige.it]
- [www.disi.unige.it]
- [www.disi.unige.it]
- [www.dcs.ed.ac.uk]
- [www.disi.unige.it]
- [www.disi.unige.it]
- DBLP

### Other Repositories/Bibliography

Venue: | Journal of Functional Programming |

Citations: | 28 - 4 self |

### BibTeX

@ARTICLE{Moggi99monadicencapsulation,

author = {E. Moggi and Amr Sabry},

title = {Monadic Encapsulation of Effects: A Revised Approach (Extended Version)},

journal = {Journal of Functional Programming},

year = {1999},

volume = {11},

pages = {2001}

}

### Years of Citing Articles

### OpenURL

### Abstract

Launchbury and Peyton Jones came up with an ingenious idea for embedding regions of imperative programming in a pure functional language like Haskell. The key idea was based on a simple modification of Hindley-Milner's type system. Our first contribution is to propose a more natural encapsulation construct exploiting higher-order kinds, which achieves the same encapsulation effect, but avoids the ad hoc type parameter of the original proposal. The second contribution is a type safety result for encapsulation of strict state using both the original encapsulation construct and the newly introduced one. We establish this result in a more expressive context than the original proposal, namely in the context of the higher-order lambda-calculus. The third contribution is a type safety result for encapsulation of lazy state in the higher-order lambda-calculus. This result resolves an outstanding open problem on which previous proof attempts failed. In all cases, we formalize the intended implementations as simple big-step operational semantics on untyped terms, which capture interesting implementation details not captured by the reduction semantics proposed previously. 1

### Citations

747 | Notions of computation and monads
- Moggi
- 1991
(Show Context)
Citation Context ...bal exception. In fact evaluating the expression does not return an int at all but rather raises the exception Error. From their first introduction to the world of programming languages (Moggi, 1989; =-=Moggi, 1991-=-), monads were used to distinguish between values, whose evaluation is pure, and computations, whose evaluation may have side-effects. The semantic separation quickly led to a stratified programming s... |

532 | Lambda Calculi with Types
- Barendregt
- 1992
(Show Context)
Citation Context ...are fairly elementary and well-established: ffl the dynamic behavior of programs is specified operationally with a structural operational semantics (SOS); ffl type systems are presented `a la Church (=-=Barendregt, 1991-=-; Cardelli, 1996), and we use erasure to remove information not needed at run-time; ffl type safety is established for an instrumented SOS, which handles also type and region information and performs ... |

465 | Comprehending Monads
- Wadler
- 1990
(Show Context)
Citation Context ...ed programming style in which a pure functional sublanguage is used to express the manipulation of values, and a monadic sublanguage is used to express the manipulation of computations (Wadler, 1992; =-=Wadler, 1990-=-). The interaction between the two sublanguages is mediated by the type system, which keeps track of the computational effects and their propagation. Hence, to write the above example in monadic style... |

296 | Abstract Types have Existential Type - Mitchell, Plotkin - 1988 |

286 | Region-based memory management - Tofte, Talpin - 1997 |

247 | Polymorphic Effect Systems - Lucassen, Gifford - 1988 |

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

210 | Type systems
- Cardelli
- 1996
(Show Context)
Citation Context ...ary and well-established: ffl the dynamic behavior of programs is specified operationally with a structural operational semantics (SOS); ffl type systems are presented `a la Church (Barendregt, 1991; =-=Cardelli, 1996-=-), and we use erasure to remove information not needed at run-time; ffl type safety is established for an instrumented SOS, which handles also type and region information and performs additional run-t... |

204 | Call-by-name, call-by-value, and the λ-calculus - Plotkin - 1975 |

154 | The type and effect discipline
- Talpin, Jouvelot
- 1992
(Show Context)
Citation Context ...actic control of interference (1978), the imperative lambda calculus (Swarup et al., 1991), lambda var (Odersky et al., 1993; Chen & Odersky, 1994; Rabin, 1996), type-and-effect systems (Tofte, 1990; =-=Talpin & Jouvelot, 1992-=-b), coercions (Riecke, 1993; Riecke & Viswanathan, 1995), and region calculi (Tofte & Talpin, 1997) to name a few. The multitude of proposals and the fact that some variants of these proposals were in... |

133 | Syntactic control of interference - Reynolds - 1978 |

124 | Polymorphic type, region and effect inference - Talpin, Jouvelot |

115 |
Type Inference for Polymorphic References
- Tofte
- 1990
(Show Context)
Citation Context ...ynolds's syntactic control of interference (1978), the imperative lambda calculus (Swarup et al., 1991), lambda var (Odersky et al., 1993; Chen & Odersky, 1994; Rabin, 1996), type-and-effect systems (=-=Tofte, 1990-=-; Talpin & Jouvelot, 1992b), coercions (Riecke, 1993; Riecke & Viswanathan, 1995), and region calculi (Tofte & Talpin, 1997) to name a few. The multitude of proposals and the fact that some variants o... |

109 | Lazy functional state threads - Launchbury, Jones, et al. - 1994 |

96 | The marriage of effects and monads - Wadler, Thiemann |

84 | Logics and Type systems
- Geuvers
- 1993
(Show Context)
Citation Context ...ction semantics is directly related to sound equational reasoning. 4 Higher Order Lambda-Calculus `a la Church We formalize the type system as a higher-order -calculus `a la Church (Barendregt, 1991; =-=Geuvers, 1993-=-). 4.1 Syntax and Formation Rules For convenience, we distinguish between constants (declared in signatures) and variables (declared in contexts). The type system uses the following syntactic categori... |

69 | Explicit polymorphism and CPS conversion - Harper, Lillibridge - 1993 |

57 | A simplified account of polymorphic references - Harper - 1994 |

53 |
The essence of functional programming (invited talk
- Wadler
- 1992
(Show Context)
Citation Context ... to a stratified programming style in which a pure functional sublanguage is used to express the manipulation of values, and a monadic sublanguage is used to express the manipulation of computations (=-=Wadler, 1992-=-; Wadler, 1990). The interaction between the two sublanguages is mediated by the type system, which keeps track of the computational effects and their propagation. Hence, to write the above example in... |

32 | Call by name, assignment, and the lambda calculus - Odersky, Rabin, et al. |

32 | Polymorphic eect systems - Lucassen, Giord - 1988 |

24 | Monadic state: Axiomatization and type safety - Launchbury, Sabry - 1997 |

24 | Polymorphic type, region, and eect inference - Talpin, Jouvelot - 1992 |

24 | The type and e#ect discipline - Talpin, Jouvelot - 1992 |

19 | Isolating side effects in sequential languages - Riecke, Viswanathan - 1995 |

18 | Lazy functional state threads - Jones - 1994 |

16 | On functors expressible in the polymorphic typed lambda calculus - Reynolds, Plotkin - 1990 |

15 | Monadic encapsulation in ML - Semmelroth, Sabry - 1999 |

12 | A type system for a lambda calculus with assignments - Chen, Odersky - 1994 |

11 | Delimiting the scope of effects
- Riecke
- 1993
(Show Context)
Citation Context ...the imperative lambda calculus (Swarup et al., 1991), lambda var (Odersky et al., 1993; Chen & Odersky, 1994; Rabin, 1996), type-and-effect systems (Tofte, 1990; Talpin & Jouvelot, 1992b), coercions (=-=Riecke, 1993-=-; Riecke & Viswanathan, 1995), and region calculi (Tofte & Talpin, 1997) to name a few. The multitude of proposals and the fact that some variants of these proposals were initially unsound, witness th... |

11 | The marriage of eects and monads - Wadler, Thiemann |

7 |
Comprehending monads. Pages 61--78 of
- Wadler
- 1990
(Show Context)
Citation Context ...ed programming style in which a pure functional sublanguage is used to express the manipulation of values, and a monadic sublanguage is used to express the manipulation of computations (Wadler, 1992; =-=Wadler, 1990-=-). The interaction between the two sublanguages is mediated by the type system, which keeps track of the computational effects and their propagation. Hence, to write the above example in monadic style... |

6 | On Functors Expressible in the Polymorphic Lambda Calculus - Reynolds, Plotkin - 1990 |

5 |
Computational lambda-calculus and monads. Pages 14–23 of
- Moggi
- 1989
(Show Context)
Citation Context ... raises a global exception. In fact evaluating the expression does not return an int at all but rather raises the exception Error. From their first introduction to the world of programming languages (=-=Moggi, 1989-=-; Moggi, 1991), monads were used to distinguish between values, whose evaluation is pure, and computations, whose evaluation may have side-effects. The semantic separation quickly led to a stratified ... |

4 | A simplified account of polymorphic references. Information Processing Letters - Harper - 1994 |

4 | Monadic Encapsulation - Semmelroth, Sabry - 1999 |

3 | Calculi for Functional Programming Languages with Assignments
- Rabin
- 1996
(Show Context)
Citation Context ...ces as required above, starting with Reynolds's syntactic control of interference (1978), the imperative lambda calculus (Swarup et al., 1991), lambda var (Odersky et al., 1993; Chen & Odersky, 1994; =-=Rabin, 1996-=-), type-and-effect systems (Tofte, 1990; Talpin & Jouvelot, 1992b), coercions (Riecke, 1993; Riecke & Viswanathan, 1995), and region calculi (Tofte & Talpin, 1997) to name a few. The multitude of prop... |

2 | A note on: "A simplified account of polymorphic references - Harper - 1996 |

2 | Syntactic control of interference. Pages 39--46 of - Reynolds - 1978 |

2 | The type and effect discipline. Pages 162--173 of - Talpin - 1992 |

2 | Monadic encapsulation of eects: A revised approach. Electronic notes in theoretical computer science - Moggi - 1999 |

2 | Delimiting the scope of eects - Riecke - 1993 |

2 | Isolating side eects in sequential languages - Riecke - 1995 |

1 | Monadic Encapsulation of Effects 39 - Swarup, Reddy - 1991 |

1 | Polymorphic effect systems. Pages 47--57 of - Lucassen - 1988 |

1 | Testing equivalences for processes (concurrent programming - Nicola, Hennessy - 1984 |

1 | Monadic state: Axiomatization and type safety - Haskell - 1995 |

1 | Monadic Encapsulation of Eects 39 - Swarup, Reddy - 1991 |