Acta Informatica

, Volume 21, Issue 3, pp 239–250 | Cite as

Using circular programs to eliminate multiple traversals of data

  • R. S. Bird


This paper describes a technique for transforming functional programs that repeatedly traverse a data structure into more efficient alternatives that do not. The transformation makes essential use of lazy evaluation and local recursion (such as provided by letrec, or its equivalent) to build a circular program that, on one pass over the structure, determines the effects of the individual traversals and then combines them.


Information System Operating System Data Structure Communication Network Information Theory 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Bird, R.S.: Programs and Machines — An Introduction to the Theory of Computation. London: John Wiley 1976Google Scholar
  2. 2.
    Burstall, R.M., Darlington, J.: A transformation system for developing recursive programs. J. ACM 24, 44–67 (1977)Google Scholar
  3. 3.
    Burstall, R.M., Macqueen, D.B., Sannella, D.T.: HOPE: an experimental applicative language. Int Res Report. Dept Computer Science, University of Edinburgh 1980Google Scholar
  4. 4.
    Feather, M.: A system for assisting program transformation. ACM Trans Progr. Lang. Syst. 4, 1–20 (1982)Google Scholar
  5. 5.
    Henderson, P.: Functional Programming: Application and Implementation. Englewood Cliffs: Prentice-Hall 1980Google Scholar
  6. 6.
    Hughes, R.J.M.: The Design and Implementation of Programming Languages. D. Phil. Thesis. Oxford University 1983Google Scholar
  7. 7.
    Kott, L.: About a transformation system: a theoretical study. Proc. Third Symp. Progr. Paris, 1971Google Scholar
  8. 8.
    Turner, D.: Recursion equations as a programming language. In: Functional Programming and its Applications (Darlington, J., Henderson, P., Turner, D. (eds.). Cambridge: University Press, 1982Google Scholar
  9. 9.
    Wadler, P.: (personal communication)Google Scholar
  10. 10.
    Wadler, P.: Listlessness is better than laziness. Ph. D. Thesis, Carnegie-Mellon University, 1984Google Scholar

Copyright information

© Springer-Verlag 1984

Authors and Affiliations

  • R. S. Bird
    • 1
  1. 1.Programming Research GroupOxford UniversityOxfordUK

Personalised recommendations