skip to main content
10.1145/178243.178246acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article
Free Access

Lazy functional state threads

Published:01 June 1994Publication History

ABSTRACT

Some algorithms make critical internal use of updatable state, even though their external specification is purely functional. Based on earlier work on monads, we present a way of securely encapsulating stateful computations that manipulate multiple, named, mutable objects, in the context of a non-strict, purely-functional language.

The security of the encapsulation is assured by the type system, using parametricity. Intriguingly, this parametricity requires the provision of a (single) constant with a rank-2 polymorphic type.

References

  1. E Barendsen L~ JEW Smetsers {Dec 1993}, "Conventional and uniqueness typing in graph rewrite systems," in Proc 13th Conference on the Foundations of Software Technology and Theoretical Computer Science, Springer Verlag LNCS. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. DK Gifford & JM Lucassen {Aug 1986}, "Integrating functional and imperative programming,'" in A CM Conference on Lisp and Functional Programming, MIT, ACM, 28-38. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. J Launchbury{June 1993}, "Lazy imperative programming,' in Proc A CM Sigplan Workshop on State in Programming Languages, Copenhagen (available as YALEU/DCS/RR- 968, Yale University), pp46-56.Google ScholarGoogle Scholar
  4. J Launchbury Lc SL Peyton Jones{Feb 1994}, "Lazy functional state threads," Technical report FP- 94-05, Department of Computing Science, University of Glasgow (FTP:ftp. dcs. glasgow, ac. uk: pub/glasgow-fp/tech-report s / FP-94-05: sta~e, ps. Z).Google ScholarGoogle Scholar
  5. NJ McCracken {June 1984}, "The typechecking of programs with implicit type structure," in Semantics of data types, Springer Verlag LNCS 173, 301-315. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. JC Mitchell & AR Meyer {1985}, "Second-order logical relations," in Logics of Programs, R Parikh, ed., Springer Verlag LNCS 193. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Rishiyur Nikhil{March 1988}, "Id Reference Manual," Lab for Computer Sci, MIT.Google ScholarGoogle Scholar
  8. M Odersky, D Rabin & P Hudak{Jan 1993}, "Call by name, assignment, and the lambda calculus," in 20th A CM Symposium on Principles of Programming Languages, Charleston, ACM, 43- 56. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. LC Paulson {1991}, ML for the working programmer, Cambridge University Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. SL Peyton Jones L~ J Launchbury{Sept 1991}, "Unboxed values as first class citizens," in Functional Programming Languages and Computer Architecture, Boston, Hughes, ed., LNCS 523, Springer Verlag, 636-666. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. SL Peyton Jones & PL Wadler {Jan 1993}, "Imperative functional programming," in 20th A CM Symposium on Principles of Programming Languages, Charleston, ACM, 71-84. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. CG Ponder, PC McOeer & A P-C Ng {June 1988}, "Are applicative languages inefficient?," $iGPLAN Notices 23, 135-139. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. DA Schmidt {Apr 1985}, "Detecting global variables in denotational specifications," TOPLAS 7, 299- 310. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. V Swarup, US Reddy & E Ireland{Sept 1991}, "As~ signments for applicative languages," in Functional Programming Languages and Computer Architecture, Boston, Hughes, ed., LNCS 523, Springer Verlag, 192-214. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M Tofte{Nov 1990}, "Type inference for polymorphic references," information and Computation 89. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Lazy functional state threads

            Recommendations

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in
            • Published in

              cover image ACM Conferences
              PLDI '94: Proceedings of the ACM SIGPLAN 1994 conference on Programming language design and implementation
              August 1994
              360 pages
              ISBN:089791662X
              DOI:10.1145/178243

              Copyright © 1994 ACM

              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: 1 June 1994

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • Article

              Acceptance Rates

              Overall Acceptance Rate406of2,067submissions,20%

              Upcoming Conference

              PLDI '24

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader