Fusion in Practice

  • Diederik van Arkel
  • John van Groningen
  • Sjaak Smetsers
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2670)


Deforestation was introduced to eliminate intermediate data structures used to connect separate parts of a functional program together. Fusion is a more sophisticated technique, based on a producer-consumer model, to eliminate intermediate data structures. It achieves better results. In this paper we extend this fusion algorithm by refining this model, and by adding new transformation rules. The extended fusion algorithm is able to deal with standard deforestation, but also with higher-order function removal and dictionary elimination. We have implemented this extended algorithm in the Clean 2.0 compiler.


Transformation Rule Recursive Function Fusion Algorithm Recursive Call Functional Program 
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. Ach02.
    P. Achten, A. Alimarine, R. Plasmeijer. When Generic Functions Use Dynamic Values. Post-workshop submission: 14th International Workshop on the Implementation of Functional Languages, IFL 2002, Madrid, Spain, September 2002.Google Scholar
  2. Ali01.
    A. Alimarine and R. Plasmeijer. A Generic Programming Extension for Clean. In: Arts, Th., Mohnen M., eds. Proceedings of the 13th International Workshop on the Implementation of Functional Languages, IFL 2001, Selected Papers, Älvsjö, Sweden, September 24–26, 2001, Springer-Verlag, LNCS 2312, pages 168–185.CrossRefGoogle Scholar
  3. Chin94.
    W.-N. Chin. Safe fusion of functional expressions II: Further improvements Journal of Functional Programming, Volume 6, Part 4, pp 515–557, 1994.CrossRefGoogle Scholar
  4. Cle13.
    R. Plasmeijer, M. van Eekelen. Language Report Concurrent Clean. Version 1.3. Technical Report CSI R9816, NIII, University of Nijmegen, June 1998. Also available at
  5. Cle20.
    R. Plasmeijer, M. van Eekelen. Language Report Concurrent Clean. Version 2.0. DRAFT!, NIII, University of Nijmegen, December 2001. Also available at
  6. Feg94.
    L. Fegaras, T. Sheard, and T. Zhou. Improving Programs which Recurse over Multiple Inductive Structures. In Proc. of ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, Orlando, FL, USA, June 1994Google Scholar
  7. Fer88.
    A. Ferguson and P. Wadler. When will Deforestation Stop. In Proc. of 1988 Glasgow Workshop on Functional Programming, pp 39–56, Rothasay, Isle of Bute, August 1988.Google Scholar
  8. Fok95.
    J. Fokker. Functional Specification of the JPEG algorithm, and an Implementation for Free, In Programming Paradigms in Graphics, Proceedings of the Eurographics workshop in Maastricht, the Netherlands, september 1995, Wien, Springer 1995, pp102–120.Google Scholar
  9. Gil96.
    A. Gill. Cheap Deforestation for Non-strict Functional Languages, PhD Thesis, Department of Computing Science, Glasgow University, 1996.Google Scholar
  10. Gil93.
    A. Gill, S. Peyton Jones, J. Launchbury. A Short Cut to Deforestation, Proc. Functional Programming Languages and Computer Architecture (FPCA’93), Copenhagen, June 1993, pp223–232.Google Scholar
  11. Har93.
    P. Hartel, K. Langendoen. Benchmarking Implementations of Lazy Functional Languages, In Proc. of Functional Programming Languages and Computer Architecture, 1993, pp341–349.Google Scholar
  12. Har94.
    P. Hartel, et al. Pseudoknot: A Float-Intensive Benchmark for Functional Compilers, 6th Implementation of Functional Languages, School of Information Systems, University of East Anglia, Norwich, UK, 1994, pp13.1–13.34.Google Scholar
  13. Has92.
    P. Hudak, S. Peyton Jones, P. Wadler, B. Boutel, J. Fairbairn, J. Fasel, K. Hammond, J. Hughes, Th. Johnsson, D. Kieburtz, R. Nikhil, W. Partain, J. Peterson. Report on the programming language Haskell, In ACM SigPlan Notices, 27 (5): 1–164. May 1992.Google Scholar
  14. Hin00.
    R. Hinze and S. Peyton Jones. Derivable Type Classes. In Graham Hutton, editor, Proceedings of the Fourth Haskell Workshop, Canada, 2000.Google Scholar
  15. Mar95.
    S. Marlow. Deforestation for Higher-Order Functional Programs PhD Thesis, Department of Computer Science, University of Glasgow, 1995.Google Scholar
  16. Pey99.
    S. Peyton Jones, S. Marlow. Secrets of the Glasgow Haskell Compiler inliner Workshop on Implementing Declarative Languages, 1999.Google Scholar
  17. Oka98.
    C. Okasaki. Purely Functional Data Structures Cambridge University Press, ISBN 0-521-63124-6, 1998.Google Scholar
  18. Sei97.
    H. Seidl, M.H. Sørensen. Constraints to Stop Higher-Order Deforestation In 24th ACM Symp. on Principles of Programming Languages, pages 400–413, 1997.Google Scholar
  19. Tak95.
    A. Takano, E. Meijer. Shortcut to Deforestation in Calculational form, Proc. Functional Programming Languages and Computer Architecture (FPCA’95), La Jolla, June 1995, pp 306–313.Google Scholar
  20. Tay98.
    S. Taylor.Optimization of Mercury programs Honours report, Department of Computer Science, University of Melbourne, Australia, November 1998.Google Scholar
  21. Wad88.
    P. Wadler. Deforestation: Transforming Programs to Eliminate Trees Proceedings of the 2nd European Symposium on Programming, Nancy, France, March 1988. Lecture Notes in Computer Science 300.Google Scholar
  22. Wad89.
    P. Wadler, S. Blott. How to make ad-hoc polymorphism less ad hoc In Proceedings 16th ACM Symposium on Principles of Programming Languages, pages 60–76, 1989.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Diederik van Arkel
    • 1
  • John van Groningen
    • 1
  • Sjaak Smetsers
    • 1
  1. 1.Computing Science InstituteUniversity of NijmegenNijmegenThe Netherlands

Personalised recommendations