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 2007 Publication 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.
[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.
[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.
[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).
[5]
Michael J. C. Gordon. 1973. An investigation of lit. Technical Report Memorandun MIP-R-101, School of Artificial Intelligence, University of Edinburgh.
[6]
Michael J. C. Gordon. 1979. On the power of list iteration. The Computer Journal, 22 (4): 376--379.
[7]
Mike Gordon. 2000. Christopher Strachey: recollections of his influence. Higher-Order and Symbolic Computation, 13 (1/2): 65--67.
[8]
Patrick Greussay. 1978. Le système VLISP 16. Université Paris-8-Vincennes et LITP.
[9]
David Hartley. 2000. Cambridge and CPL in the 1960s. Higher-Order and Symbolic Computation, 13 (1/2): 69--70.
[10]
John Hughes. 1986. A novel representation of lists and its application to the function "reverse". Information Processing Letters, 22 (3): 141--144.
[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.
[12]
Martin Richards. 2000. Christopher strachey and the Cambridge CPL compiler. Higher-Order and Symbolic Computation, 13 (1/2): 85--88.
[13]
Christopher Strachey. 1961. Handwritten notes. Archive of working papers and correspondence. Bodleian Library, Oxford, Catalogue no. MS. Eng. misc. b.267.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

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
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 October 2007

Permissions

Request permissions for this article.

Check for updates

Author Tag

  1. CPL

Qualifiers

  • Article

Conference

ICFP07
Sponsor:

Acceptance Rates

Overall Acceptance Rate 333 of 1,064 submissions, 31%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)8
  • Downloads (Last 6 weeks)5
Reflects downloads up to 27 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Program Synthesis Using Example PropagationPractical Aspects of Declarative Languages10.1007/978-3-031-24841-2_2(20-36)Online publication date: 8-Jan-2023
  • (2020)From Curry to HaskellPhilosophy & Technology10.1007/s13347-019-00385-4Online publication date: 13-Feb-2020
  • (2019)Safer smart contract programming with ScillaProceedings of the ACM on Programming Languages10.1145/33606113:OOPSLA(1-30)Online publication date: 10-Oct-2019
  • (2019)Folding left and right over Peano numbersJournal of Functional Programming10.1017/S095679681900004229Online publication date: 17-Apr-2019
  • (2015)Synthesizing data structure transformations from input-output examplesACM SIGPLAN Notices10.1145/2813885.273797750:6(229-239)Online publication date: 3-Jun-2015
  • (2015)Synthesizing data structure transformations from input-output examplesProceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/2737924.2737977(229-239)Online publication date: 3-Jun-2015
  • (2019)Safer smart contract programming with ScillaProceedings of the ACM on Programming Languages10.1145/33606113:OOPSLA(1-30)Online publication date: 10-Oct-2019
  • (2015)Synthesizing data structure transformations from input-output examplesProceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/2737924.2737977(229-239)Online publication date: 3-Jun-2015

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media