Skip to main content
Log in

Using circular programs to eliminate multiple traversals of data

  • Published:
Acta Informatica Aims and scope Submit manuscript

Summary

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. Bird, R.S.: Programs and Machines — An Introduction to the Theory of Computation. London: John Wiley 1976

    Google Scholar 

  2. Burstall, R.M., Darlington, J.: A transformation system for developing recursive programs. J. ACM 24, 44–67 (1977)

    Google Scholar 

  3. Burstall, R.M., Macqueen, D.B., Sannella, D.T.: HOPE: an experimental applicative language. Int Res Report. Dept Computer Science, University of Edinburgh 1980

  4. Feather, M.: A system for assisting program transformation. ACM Trans Progr. Lang. Syst. 4, 1–20 (1982)

    Google Scholar 

  5. Henderson, P.: Functional Programming: Application and Implementation. Englewood Cliffs: Prentice-Hall 1980

    Google Scholar 

  6. Hughes, R.J.M.: The Design and Implementation of Programming Languages. D. Phil. Thesis. Oxford University 1983

  7. Kott, L.: About a transformation system: a theoretical study. Proc. Third Symp. Progr. Paris, 1971

  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, 1982

    Google Scholar 

  9. Wadler, P.: (personal communication)

  10. Wadler, P.: Listlessness is better than laziness. Ph. D. Thesis, Carnegie-Mellon University, 1984

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Bird, R.S. Using circular programs to eliminate multiple traversals of data. Acta Informatica 21, 239–250 (1984). https://doi.org/10.1007/BF00264249

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF00264249

Keywords

Navigation