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.
Article PDF
Similar content being viewed by others
Avoid common mistakes on your manuscript.
References
Bird, R.S.: Programs and Machines — An Introduction to the Theory of Computation. London: John Wiley 1976
Burstall, R.M., Darlington, J.: A transformation system for developing recursive programs. J. ACM 24, 44–67 (1977)
Burstall, R.M., Macqueen, D.B., Sannella, D.T.: HOPE: an experimental applicative language. Int Res Report. Dept Computer Science, University of Edinburgh 1980
Feather, M.: A system for assisting program transformation. ACM Trans Progr. Lang. Syst. 4, 1–20 (1982)
Henderson, P.: Functional Programming: Application and Implementation. Englewood Cliffs: Prentice-Hall 1980
Hughes, R.J.M.: The Design and Implementation of Programming Languages. D. Phil. Thesis. Oxford University 1983
Kott, L.: About a transformation system: a theoretical study. Proc. Third Symp. Progr. Paris, 1971
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
Wadler, P.: (personal communication)
Wadler, P.: Listlessness is better than laziness. Ph. D. Thesis, Carnegie-Mellon University, 1984
Author information
Authors and Affiliations
Rights 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
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF00264249