Abstract
The aim of transforming programs into fully-lazy form is to avoid recomputations by sharing as much computation as possible. In this paper we shall see how to improve programs, such that even more computation can be shared when the programs are transformed into fully-lazy form. This is done by treating control constructs specially. The idea is that when the condition in a conditional can be evaluated then the conditional should be reduced away (if True t e) should reduce to t even if t cannot be computed. We achieve this by transforming the conditionals such that the branches always can be evaluated when the condition can be evaluated. The results we achieve using this technique compares well with the results achieved by partial evaluation.
Supported by University of Copenhagen, The Danish Research Academy
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Carsten Kehler Holst. Program specialization for compiler generation. Master’s thesis, Department of Computer Science, University of Copenhagen (DIKU), Denmark, May 1989.
Carsten Kehler Holst and John Hughes. Towards improving binding time for free! In 3rd Glasgow Functional Programming Workshop,Ullapool, Scotland, 1990. Springer-Verlag.
Paul Hudak and Philip Wadler (editors). Report on the programming language Haskell. Tecnical report, Yale University and Glasgow University, April 1990.
John Hughes. The Design and Implementation of Programming Languages. PhD thesis, Oxford, 1983.
Neil D. Jones, Peter A. Sestoft, and Harald Sondergaard. Mix: A self-applicable partial evaluator for experiments in compiler generation. Lisp and Symbolic Computation, 2 (1): 9–50, 1989.
Torben Æ. Mogensen. The application of partial evaluation to ray-tracing. Master’s thesis, DIKU, University of Copenhagen, Denmark, 1986.
Torben Æ. Mogensen. Separating binding times in language specifications. In Functional Programming Languages and Computer Architecture,pages 14–25, London, England, September 1989. ACM, ACM Press and Addison-Wesley.
Hanne Rus Nielson and Flemming Nielson. Eureka definitions for free! or disagreement points for fold/unfold transformations. In Neil D. Jones, editor, ESOP ‘80 3rd European Symposium on Programming, volume 432 of Lecture Notes in Computer Science, pages 291–305, Copenhagen, Denmark, May 1990. Springer-Verlag.
Simon L. Peyton Jones and David Lester. A modular fully-lazy lambda lifter in Haskell. CS Report CSC 90/R17, Department of Computing Science, University of Glasgow, June 1990.
Peter Sestoft. The structure of a self-applicable partial evaluator. In Harald Ganzinger and Neil D. Jones, editors, Programs as Data Objects, volume 217 of Lecture Notes in Computer Science, pages 236–256, Copenhagen, Denmark, 1986. Springer-Verlag.
David Turner. An overview of Miranda. Sigplan Notices, 21 (12): 158–166, December 1986.
Philip Wadler. Theorems for free! In Functional Programming Languages and Computer Architectures,pages 347–359, London, September 1989. ACM.
Philip Wadler and Quentin Miller. An introduction to Orwell, 1985. Programming Research Group, Oxford.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Holst, C.K. (1991). Improving Full Laziness. In: Jones, S.L.P., Hutton, G., Holst, C.K. (eds) Functional Programming, Glasgow 1990. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3810-5_7
Download citation
DOI: https://doi.org/10.1007/978-1-4471-3810-5_7
Publisher Name: Springer, London
Print ISBN: 978-3-540-19667-9
Online ISBN: 978-1-4471-3810-5
eBook Packages: Springer Book Archive