The marriage of effects and monads

Gifford and others proposed an effect typing discipline to delimit the scope of computational effects within a program, while Moggi and others proposed monads for much the same purpose. Here we marry effects to monads, uniting two previously separate lines of research. In particular, we show that the type, region, and effect system of Talpin and Jouvelot carries over directly to an analogous system for monads, including a type and effect reconstruction algorithm. The same technique should allow one to transpose any effect systems into a corresponding monad system.

[1]  Andrew M. Pitts,et al.  Higher order operational techniques in semantics , 1999 .

[2]  Joannes M. Lucassen Types and Effects Towards the Integration of Functional and Imperative Programming. , 1987 .

[3]  Pierre Jouvelot,et al.  The Type and Effect Discipline , 1994, Inf. Comput..

[4]  Simon L. Peyton Jones,et al.  A semantics for imprecise exceptions , 1999, PLDI '99.

[5]  Mads Tofte,et al.  Implementation of the typed call-by-value λ-calculus using a stack of regions , 1994, POPL '94.

[6]  Simon L. Peyton Jones,et al.  Concurrent Haskell , 1996, POPL '96.

[7]  Ralf Hinze,et al.  Haskell 98 — A Non−strict‚ Purely Functional Language , 1999 .

[8]  Gilles Barthe,et al.  Monadic Type Systems: Pure Type Systems for Impure Settings , 1997, Electron. Notes Theor. Comput. Sci..

[9]  Philip Wadler,et al.  Monads for functional programming , 1995, NATO ASI PDC.

[10]  David K. Gifford,et al.  Polymorphic effect systems , 1988, POPL '88.

[11]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[12]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[13]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[14]  Lars Birkedal,et al.  A region inference algorithm , 1998, TOPL.

[15]  John C. Mitchell,et al.  Type inference with simple subtypes , 1991, Journal of Functional Programming.

[16]  John C. Mitchell,et al.  Foundations for programming languages , 1996, Foundation of computing series.

[17]  Philip Wadler,et al.  Comprehending monads , 1990, Mathematical Structures in Computer Science.

[18]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..

[19]  Xavier Leroy,et al.  Polymorphism by name for references and continuations , 1993, POPL '93.

[20]  Simon L. Peyton Jones,et al.  Calling hell from heaven and heaven from hell , 1999, ICFP '99.

[21]  Pierre Jouvelot,et al.  Reasoning about continuations with control effects , 1989, PLDI '89.

[22]  Mark P. Jones,et al.  Functional Programming with Overloading and Higher-Order Polymorphism , 1995, Advanced Functional Programming.

[23]  Nick Benton,et al.  Compiling standard ML to Java bytecodes , 1998, ICFP '98.

[24]  Andrew P. Tolmach,et al.  Optimizing ML Using a Hierarchy of Monadic Types , 1998, Types in Compilation.

[25]  Andrew K. Wright Typing References by Effect Inference , 1992, ESOP.

[26]  Simon L. Peyton Jones,et al.  Lazy functional state threads , 1994, PLDI '94.

[27]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[28]  Simon L. Peyton Jones,et al.  Imperative functional programming , 1993, POPL '93.

[29]  Amr Sabry,et al.  Monadic encapsulation in ML , 1999, ICFP '99.

[30]  Andrew K. Wright Simple imperative polymorphism , 1995, LISP Symb. Comput..

[31]  Eugenio Moggi,et al.  Monadic Encapsulation of Effects: a Revised Approach , 1999, Electron. Notes Theor. Comput. Sci..

[32]  Flemming Nielson,et al.  Polymorphic Subtyping for Effect Analysis: The Static Semantics , 1996, LOMAPS.

[33]  Olivier Danvy,et al.  A generic account of continuation-passing styles , 1994, POPL '94.

[34]  Philip Wadler,et al.  The essence of functional programming , 1992, POPL '92.

[35]  Thierry Coquand,et al.  Inheritance and explicit coercion , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[36]  Philip Wadler,et al.  Comprehending monads , 1990, LISP and Functional Programming.

[37]  Pierre Jouvelot,et al.  Polymorphic type, region and effect inference , 1992, Journal of Functional Programming.

[38]  Robin Milner,et al.  Definition of standard ML , 1990 .

[39]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[40]  David K. Gifford,et al.  Integrating functional and imperative programming , 1986, LFP '86.

[41]  Mark Lillibridge,et al.  Polymorphic type assignment and CPS conversion , 1993, LISP Symb. Comput..

[42]  Philip Wadler,et al.  The essence of functional programming (Invited talk) , 1997 .

[43]  Philip Wadler Monads for Functional Programming , 1995, Advanced Functional Programming.

[44]  M. Tofte Operational Semantics and Polymorphic Type Inference , 1988 .