Skip to main content

Type-Inference Based Short Cut Deforestation (Nearly) without Inlining

  • Conference paper
Implementation of Functional Languages (IFL 1999)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1868))

Included in the following conference series:

Abstract

Deforestation optimises a functional program by transforming it into another one that does not create certain intermediate data structures. Our type-inference based deforestation algorithm performs extensive inlining, but only limited inlining across module boundaries is practically feasible. Therefore we here present a type-inference based algorithm that splits a function definition into a worker definition and a wrapper definition. For deforestation we only need to inline the small wrappers which transfer the required information. We show that we even can deforest definitions of functions that consume their own result with the worker/wrapper scheme, in contrast to the original algorithm with inlining.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Chitil, O.: Type inference builds a short cut to deforestation. ACM SIGPLAN Notices 34(9), 249–260 (1999); Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP 1999)

    Google Scholar 

  2. Damas, L., Milner, R.: Principal type-schemes for functional programs. In: Conference Record of the Ninth Annual ACM Symposium on Principles of Programming Languages, pp. 207–212. ACM Press, New York (1982)

    Chapter  Google Scholar 

  3. Emms, M., Leiß, H.: Extending the type checker of Standard ML by polymorphic recursion. Theoretical Computer Science 212(1–2), 157–181 (1999)

    Google Scholar 

  4. The Glasgow Haskell compiler, http://www.haskell.org/ghc/

  5. Gill, A.: Cheap Deforestation for Non-strict Functional Languages. PhD thesis, Glasgow University (1996)

    Google Scholar 

  6. Gill, A., Launchbury, J., Jones, S.L.P.: A Short Cut to Deforestation. In: FPCA 1993, Conference on Functional Programming Languages and Computer Architecture, pp. 223–232. ACM Press, New York (1993)

    Chapter  Google Scholar 

  7. Henglein, F.: Type inference with polymorphic recursion. ACM Transactions on Programming Languages and Systems 15(2), 253–289 (1993)

    Article  Google Scholar 

  8. Hughes, J.: Why Functional Programming Matters. Computer Journal 32(2), 98–107 (1989)

    Article  Google Scholar 

  9. Kfoury, A.J., Tiuryn, J., Urzyczyn, P.: Type reconstruction in the presence of polymorphic recursion. ACM Transactions on Programming Languages and Systems 15(2), 290–311 (1993)

    Article  Google Scholar 

  10. Launchbury, J., Sheard, T.: Warm fusion: Deriving build-catas from recursive definitions. In: Conf. Record 7th ACM SIGPLAN/SIGARCH Intl. Conf. on Functional Programming Languages and Computer Architecture, FPCA 1995, pp. 314–323. ACM Press, New York (1995)

    Chapter  Google Scholar 

  11. Lee, O., Yi, K.: Proofs about a folklore let-polymorphic type inference algorithm. ACM Transactions on Programming Languages and Systems 20(4), 707–723 (1998)

    Article  Google Scholar 

  12. Mycroft, A.: Polymorphic type schemes and recursive definitions. In: Paul, M., Robinet, B. (eds.) Programming 1984. LNCS, vol. 167, pp. 217–228. Springer, Heidelberg (1984)

    Google Scholar 

  13. Jones, S.L.P., Hughes, J., et al.: Haskell 98: A non-strict, purely functional language (February 1999), http://www.haskell.org

  14. Jones, S.L.P., Launchbury, J.: Unboxed values as first class citizens in a non-strict functional language. In: Hughes, J. (ed.) FPCA 1991. LNCS, vol. 523, pp. 636–666. Springer, Heidelberg (1991)

    Google Scholar 

  15. Jones, S.L.P., Marlow, S.: Secrets of the Glasgow Haskell compiler inliner. In: IDL 1999 (1999), http://www.binnetcorp.com/wshops/IDL99.html

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2000 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Chitil, O. (2000). Type-Inference Based Short Cut Deforestation (Nearly) without Inlining. In: Koopman, P., Clack, C. (eds) Implementation of Functional Languages. IFL 1999. Lecture Notes in Computer Science, vol 1868. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10722298_2

Download citation

  • DOI: https://doi.org/10.1007/10722298_2

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-67864-9

  • Online ISBN: 978-3-540-44658-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics