skip to main content
10.1145/581478.581482acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article

Monads for incremental computing

Published:17 September 2002Publication History

ABSTRACT

This paper presents a monadic approach to incremental computation, suitable for purely functional languages such as Haskell. A program that uses incremental computation is able to perform an incremental amount of computation to accommodate for changes in input data. Recently, Acar, Blelloch and Harper presented a small Standard ML library that supports efficient, high-level incremental computations [1]. Here, we present a monadic variant of that library, written in Haskell extended with first-class references. By using monads, not only are we able to provide a purely functional interface to the library, the types also enforce "correct usage" without having to resort to any type-system extension. We also find optimization opportunities based on standard monadic combinators.This is an exercise in putting to work monad transformers with environments, references, and continuations.

References

  1. U. Acar, G. Blelloch, and R. Harper. Adaptive functional programming. In Principles of Programming Languages (POPL02), Portland, Oregon, January 2002. ACM.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. L. Augustsson. Cayenne --- a language with dependent types. In Proc. of the International Conference on Functional Programming (ICFP'98). ACM Press, September 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. Carlsson. Adaptive --- incremental computations in Haskell. www.cse.ogi.edu/~magnus/Adaptive/, 2002.]]Google ScholarGoogle Scholar
  4. P. F. Dietz and D. D. Sleator. Two algorithms for mainitaining order in a list. In Proceedings. 19th ACM Symposium. Theory of Computing, 1987.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. The Glasgow Haskell compiler. www.haskell.org/ghc/.]]Google ScholarGoogle Scholar
  6. The Hugs 98 interpreter. www.haskell.org/hugs/.]]Google ScholarGoogle Scholar
  7. M. P. Jones. Type Classes with Functional Dependencies. In Proceedings of the 9th European Symposiumon Programming, ESOP 2000, number 1782 in LNCS, Berlin, Germany, March 2000. Springer-Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. S. P. Jones, M. P. Jones, and E. Meijer. Type classes: exploring the design space. In Haskell Workshop, 1997.]]Google ScholarGoogle Scholar
  9. J. Launchbury and S. Peyton Jones. Lazy functional state threads. In ACM Programming Languages Design and Implementation, Orlando, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. Liang, P. Hudak, and M. P. Jones. Monad transformers and modular interpreters. In Conference Record of POPL'95: 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 333--343, San Francisco, California, Jan. 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. R. Milner, M. Tofte, R. Harper, and D. MacQueen. The Definition of Standard ML (Revised). MIT Press, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. S. Peyton~Jones et al. The Haskell 98 libraries. haskell.org/onlinelibrary/, 1999.]]Google ScholarGoogle Scholar
  13. S. Peyton~Jones et al. Report on the programming language Haskell 98, a non-strict, purely functional language. Available from http://haskell.org, February 1999.]]Google ScholarGoogle Scholar
  14. T. Sheard. Generic unification via two-level types and parameterized modules. In International Conference on Functional Programming, Florence, Italy, 2001. ACM.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Shields and S. P. Jones. First class modules for Haskell. In 9th International Conference on Foundations of Object-Oriented Languages (FOOL 9), Portland, Oregon, pages 28--40, Jan. 2002.]]Google ScholarGoogle Scholar
  16. P. Wadler. The essence of functional programming. In Proceedings 1992 Symposium on Principles of Programming Languages, pages 1--14, Albuquerque, New Mexico, 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Monads for incremental computing

    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
      ICFP '02: Proceedings of the seventh ACM SIGPLAN international conference on Functional programming
      October 2002
      294 pages
      ISBN:1581134878
      DOI:10.1145/581478
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 37, Issue 9
        September 2002
        283 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/583852
        Issue’s Table of Contents

      Copyright © 2002 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: 17 September 2002

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • Article

      Acceptance Rates

      ICFP '02 Paper Acceptance Rate24of76submissions,32%Overall Acceptance Rate333of1,064submissions,31%

      Upcoming Conference

      ICFP '24

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader