Monadic state: axiomatization and type safety

Type safety of imperative programs is an area fraught with difficulty and requiring great care. The SML solution to the problem, originally involving imperative type variables, has been recently simplified to the syntactic-value restriction. In Haskell, the problem is addressed in a rather different way using explicit monadic state. We present an operational semantics for state in Haskell and the first full proof of type safety. We demonstrate that the semantic notion of value provided by the explicit monadic types is able to avoid any problems with generalization.

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

[2]  Luís Damas,et al.  Type assignment in programming languages , 1984 .

[3]  Hans-Juergen Boehm,et al.  Side effects and aliasing can have simple axiomatic descriptions , 1985, TOPL.

[4]  C. A. R. Hoare,et al.  Laws of programming , 1987, CACM.

[5]  Matthias Felleisen,et al.  A calculus for assignments in higher-order languages , 1987, POPL '87.

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

[7]  Mads Tofte,et al.  Type Inference for Polymorphic References , 1990, Inf. Comput..

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

[9]  Vipin Swarup,et al.  Assignments for Applicative Languages , 1991, FPCA.

[10]  Carolyn L. Talcott,et al.  1 Equivalence in Functional Languages with E ectsIan , 2007 .

[11]  Matthias Felleisen,et al.  Parameter-passing and the lambda calculus , 1991, POPL '91.

[12]  Robert Hieb,et al.  The Revised Report on the Syntactic Theories of Sequential Control and State , 1992, Theor. Comput. Sci..

[13]  Pierre Jouvelot,et al.  The type and effect discipline , 1992, [1992] Proceedings of the Seventh Annual IEEE Symposium on Logic in Computer Science.

[14]  Peter W. O'Hearn,et al.  Relational parametricity and local variables , 1993, POPL '93.

[15]  Jon G. Riecke Delimiting the scope of effects , 1993, FPCA '93.

[16]  Paul Hudak,et al.  Call by name, assignment, and the lambda calculus , 1993, POPL '93.

[17]  Amr Sabry,et al.  Reasoning about Explicit and Implicit Representations of State , 1993 .

[18]  J. Riecke Delimiting the Scope of Eeects , 1993 .

[19]  Martin Odersky,et al.  A Type System for a Lambda Calculus with Assignments , 1994, TACS.

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

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

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

[23]  Ramesh Viswanathan,et al.  Isolating side effects in sequential languages , 1995, POPL '95.

[24]  Simon L. Peyton Jones,et al.  State in Haskell , 1995, LISP Symb. Comput..

[25]  R. Viswanathan,et al.  Isolating Side E ects in Sequential , 1995 .

[26]  Matthias Felleisen,et al.  A call-by-need lambda calculus , 1995, POPL '95.

[27]  Paul Hudak,et al.  Calculi for functional programming languages with assignment , 1996 .

[28]  Matthias Felleisen,et al.  The call-by-need lambda calculus , 1997, Journal of Functional Programming.

[29]  David B. MacQueen,et al.  The Definition of Standard ML (Revised) , 1997 .