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

On Barron and Strachey's cartesian product function

Published:01 October 2007Publication History

ABSTRACT

Over forty years ago, David Barron and Christopher Strachey published a startlingly elegant program for the Cartesian product of a list of lists, expressing it with a three nested occurrences of the function we now call foldr. This program is remarkable for its time because of its masterful display of higher-order functions and lexical scope, and we put it forward as possibly the first ever functional pearl. We first characterize it as the result of a sequence of program transformations, and then apply similar transformations to a program for the classical power set example. We also show that using a higher-order representation of lists allows a definition of the Cartesian product function where foldr is nested only twice.

References

  1. David Barron. 1975. Christopher Strachey: a personal reminiscence. Computer Bulletin, 2 (5): 8-9.Google ScholarGoogle Scholar
  2. David W. Barron and Christopher Strachey. 1966. Programming. In Leslie Fox, editor, Advances in Programming and Non-Numerical Computation, pages 49--82. Pergammon Press.Google ScholarGoogle Scholar
  3. Olivier Danvy and Lasse R. Nielsen. 2001. Defunctionalization at work. In Harald Søndergaard, editor, Proceedings of the Third International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming (PPDP'01), pages 162--174, Firenze, Italy. ACM Press. Extended version available as the research report BRICS RS-01-23. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Olivier Danvy and Ulrik P. Schultz. 2000. Lambda-dropping: Transforming recursive equations into programs with block structure. Theoretical Computer Science, 248 (1-2): 243--287. A preliminary version was presented at the 1997 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM 1997). Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Michael J. C. Gordon. 1973. An investigation of lit. Technical Report Memorandun MIP-R-101, School of Artificial Intelligence, University of Edinburgh.Google ScholarGoogle Scholar
  6. Michael J. C. Gordon. 1979. On the power of list iteration. The Computer Journal, 22 (4): 376--379.Google ScholarGoogle ScholarCross RefCross Ref
  7. Mike Gordon. 2000. Christopher Strachey: recollections of his influence. Higher-Order and Symbolic Computation, 13 (1/2): 65--67. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Patrick Greussay. 1978. Le système VLISP 16. Université Paris-8-Vincennes et LITP.Google ScholarGoogle Scholar
  9. David Hartley. 2000. Cambridge and CPL in the 1960s. Higher-Order and Symbolic Computation, 13 (1/2): 69--70. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. John Hughes. 1986. A novel representation of lists and its application to the function "reverse". Information Processing Letters, 22 (3): 141--144. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Thomas Johnsson. 1987. Attribute grammars as a functional programming paradigm. In Gilles Kahn, editor, Functional Programming Languages and Computer Architecture, number 274 in Lecture Notes in Computer Science, pages 154--173, Portland, Oregon. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Martin Richards. 2000. Christopher strachey and the Cambridge CPL compiler. Higher-Order and Symbolic Computation, 13 (1/2): 85--88. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Christopher Strachey. 1961. Handwritten notes. Archive of working papers and correspondence. Bodleian Library, Oxford, Catalogue no. MS. Eng. misc. b.267.Google ScholarGoogle Scholar

Index Terms

  1. On Barron and Strachey's cartesian product function

      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 '07: Proceedings of the 12th ACM SIGPLAN international conference on Functional programming
        October 2007
        346 pages
        ISBN:9781595938152
        DOI:10.1145/1291151
        • cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 42, Issue 9
          Proceedings of the ICFP '07 conference
          September 2007
          331 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/1291220
          Issue’s Table of Contents

        Copyright © 2007 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 1 October 2007

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Author Tags

        Qualifiers

        • Article

        Acceptance Rates

        Overall Acceptance Rate333of1,064submissions,31%

        Upcoming Conference

        ICFP '23

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!