Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article
Free access

Monadic state: axiomatization and type safety

Published: 01 August 1997 Publication History
  • Get Citation Alerts
  • Abstract

    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.

    References

    [1]
    ARIOLA, Z. M., AND FELLEISEN, M. The call-by-need lambda calculus. To appear in the Journal of Functional ProgramminE, 1996.
    [2]
    ARIOLA, Z. M., FELLEISEN, M., MARAIST, J., ODERSKY, M., AND WAOLER, P. A call-by-need lambda calculus. In A CM Symposium on Principles of Programming Languages (1995), pp. 233-246.
    [3]
    BOEHM, H.-J. Side effects and aliasing can have simple axiomatic descriptions. A CM T~ansactions on Programming Languages and Systems 7, 4 (Oct. 1985), 637-655.
    [4]
    CHEN, K., AND ODERSKY, M. A type system for a lambda calculus with assignment. In Theoretical Aspects of Compurer Software (1994), Springer Verlag, LNCS 789.
    [5]
    CRANK, E., AND FELLEISEN, M. Parameter-passing and the lambda calculus. In A CM Symposium on Principles of Programming Languages (1991), pp. 233-244.
    [6]
    DAMAS, L. M. Type Assignment in Programming Languages. PhD thesis, University of Edinburgh, 1985.
    [7]
    FELLEISEN, M., AND FRIEDMAN, D. A calculus for assignments in higher-order languages. In A CM Symposium on Principles of Programming Languages (1987), pp. 314-325.
    [8]
    FELLEISEN, M., AND HIEB, R. The revised report on the syntactic theories of sequential control and state. Theoretical Computer Science 102 (1992), 235-271. Technical Report 89-100, Rice University.
    [9]
    HOARE, C., HAYES, I., JIFENG, H., MORGAN, C., ROSCOE, A., SANDERS, J., SORENSEN, I., SP!VRY, J., AND SuttoN, B. Laws of programming. Communications of the A CM 30, 8 (1987), 672-686.
    [10]
    LAUNCHBURY, J. Lazy imperative programming. Technical Report, Yale University, 1993. ACM SIGPLAN Workshop on State in Programming Languages.
    [11]
    LAUNCHBURY, J., AND PEYTON JONES, S. L. Lazy functional state threads. In A CM SIGPLAN Conference on Programming Language Design and Implementation (1994), pp. 24- 35.
    [12]
    LAUNCHBURY, J., ANO PEYTON JONES, S. L. State in Haskell. Lisp and Symbolic Computation 8 (1995), 193-341.
    [13]
    MASON, I., AND TALCOTT, C. L. Equivalence in functional languages with effects. Journal of Functional Programming 1, 3 (July 1991), 287-327.
    [14]
    MILNER, R. A theory of type polymorphism in programming. Journal of Computer and System Sciences 17 (1978).
    [15]
    MILNER, R., TOFTE, M., HARPER, R., AND MACQUEEN, D. The Definition of Standard ML, Revised 1996. Forthcoming, 1996.
    [16]
    ODERSKY, M. A syntactic theory of local names. Technical Report YALEU/DCS/RR-965, Yale University, 1993.
    [17]
    ODERSKY, M., RABIN, D., AND HUDAK, P. Call by name, assignment, and the lambda calculus, in A CM Symposium on Principles of Programming Languages (Jan. 1993), pp. 43- 56.
    [18]
    O'HEARN, P. W., AND TENNENT, R. D. Relational parametricity and local variables. In A GM Symposium on Principles of Programming Languages (1993).
    [19]
    PETERSON, JOHN, ET AL. Report on the programming language Haskell (version 1.3). Technical Report YALEU/DCS/RR-1106, Yale University, 1996.
    [20]
    RABIN, D. Calculi for Functional Prmjramming Languages with Assignments. PhD thesis, Yale University, 1996. Technical Report YALEU/DCS/RR-1107.
    [21]
    RIECKE, J. G. Delimiting the scope of effects. In Conference on Functional Programming and Computer Architecture (1993), pp. 146-155.
    [22]
    RIECKE, J. G., AND VISWANATHAN, R. Isolating side effects in sequential languages. In A GM Symporium on Principles of Programming Languages (1995), pp. 1-12.
    [23]
    SABRY, A., AND FIELO, J. Reasoning about explicit and implicit representations of state. Technical Report YALEU/DCS/RR-968, Yale University, 1993. ACM SIG- PLAN Workshop on State in Programming Languages, pages 17-30.
    [24]
    SWARUP, V., REDDY, U., AND IRP. LANO, E. Assignments for applicative languages. In Conference on Functional Programming and Computer Architecture (1991), pp. 192-214.
    [25]
    TALPIN, J., AND JOUVELOT, P. The type and effect discipline. In IEEE Symposium on Logic in Computer Science (June 1992), pp. 162-173.
    [26]
    TOFTE, M. Type inference for polymorphic references. Information and Computation 89, 1 (November 1990), 1-34.
    [27]
    TORTS, M., ^ND TALPIN, J. Implementing the call-by-value calculus using a stack of regions. In A CM Symposium on Principles of Programming Languages (1994), pp. 188-201.
    [28]
    WADLER, P. Comprehending monads. In A CM Conference on Lisp and Functional Programming (1990), pp. 61-78.
    [29]
    WRIGHT, A. K., ANI) F~.LLEmRN, M. A syntactic approach to type soundness. Technical Report 91-160, Rice University, April 1991. Final version in Information and Computation 115 (1), 1994, 38-94.

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 32, Issue 8
    Aug. 1997
    322 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/258949
    Issue’s Table of Contents
    • cover image ACM Conferences
      ICFP '97: Proceedings of the second ACM SIGPLAN international conference on Functional programming
      August 1997
      326 pages
      ISBN:0897919181
      DOI:10.1145/258948
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 01 August 1997
    Published in SIGPLAN Volume 32, Issue 8

    Check for updates

    Qualifiers

    • Article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)64
    • Downloads (Last 6 weeks)5

    Other Metrics

    Citations

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Get Access

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media