skip to main content
10.1145/317636.317775acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article
Free Access

When is a functional program not a functional program?

Published:01 September 1999Publication History

ABSTRACT

In an impure functional language, there are programs whose behaviour is completely functional (in that they behave extensionally on inputs), but the functions they compute cannot be written in the purely functional fragment of the language. That is, the class of programs with functional behaviour is more expressive than the usual class of pure functional programs. In this paper we introduce this extended class of "functional" programs by means of examples in Standard ML, and explore what they might have to offer to programmers and language implementors.After reviewing some theoretical background, we present some examples of functions of the above kind, and discuss how they may be implemented. We then consider two possible programming applications for these functions: the implementation of a search algorithm, and an algorithm for exact real-number integration. We discuss the advantages and limitations of this style of programming relative to other approaches. We also consider the increased scope for compiler optimizations that these functions would offer.

References

  1. 1.A. Bucciaxelli and T. Ehrhard. Sequentiality and strong stability. In Proc. 6th Annual Symposium on Logic in Computer Science, pages 138-145. IEE;E, 1991.Google ScholarGoogle Scholar
  2. 2.T. Ehrhard. Projecting sequential algorithms on strongly stable functions. Annals of Pure and Applied Logic, 77:201-244, 1996.Google ScholarGoogle ScholarCross RefCross Ref
  3. 3.S. Peyton Jones and J. Hughes (eds.). Report on the programming language Haskell 98. Available electronically from www.haskell.org, February 1999.Google ScholarGoogle Scholar
  4. 4.J.R. Longley. The sequentially realizable functionals. Technical Report ECS-LFCS-98-402: Department of Computer Science, University of Edinburgh, 1998. Submitted to Annals of Pure and Applied Logic.Google ScholarGoogle Scholar
  5. 5.J.R. Longley. When is a functional program not a functional program?: a walkthrough introduction to the sequentially realizable functionals. ML source file, available from http://www, dcs. ed.ac .uk/hom/jrl/, 1998.Google ScholarGoogle Scholar
  6. 6.R. MiMer, M. Tofte, R. Harper, and D. MacQueen. The Definition of Standard ML: revised 1997. MIT Press, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7.J. van Oosten. A combinatory algebra for sequential functionals of finite type. Technical Report 996, University of Utrecht, 1997. To appear in Proc. Logic Colloquium, Leeds.Google ScholarGoogle Scholar
  8. 8.S. Peyton Jones and S. Marlow. Stretching the storage manager: weak pointers and stable names in Haskell. Draft paper, 1999.Google ScholarGoogle Scholar
  9. 9.G.D. Plotldn. LCF considered as a programming language. Theoretical Computer Science, 5:223-255, 1977.Google ScholarGoogle ScholarCross RefCross Ref
  10. 10.D.S. Scott. A type-theoretical alternative to ISWIM, CUCH, OWHY. Theoretical Comp. $ci. , 121:411-440, 1993. First written in 1969 and widely circulated in unpublished form since then. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11.A.K. Simpson. Lazy functional algorithms for exact real functionals. In Mathematical Foundations of Computer Science, pages 456-464. Springer LNCS 1450, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. When is a functional program not a functional program?

          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 '99: Proceedings of the fourth ACM SIGPLAN international conference on Functional programming
            September 1999
            288 pages
            ISBN:1581131119
            DOI:10.1145/317636
            • Chairmen:
            • Didier Rémy,
            • Peter Lee

            Copyright © 1999 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 September 1999

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • Article

            Acceptance Rates

            ICFP '99 Paper Acceptance Rate25of81submissions,31%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