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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
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)
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)
Emms, M., Leiß, H.: Extending the type checker of Standard ML by polymorphic recursion. Theoretical Computer Science 212(1–2), 157–181 (1999)
The Glasgow Haskell compiler, http://www.haskell.org/ghc/
Gill, A.: Cheap Deforestation for Non-strict Functional Languages. PhD thesis, Glasgow University (1996)
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)
Henglein, F.: Type inference with polymorphic recursion. ACM Transactions on Programming Languages and Systems 15(2), 253–289 (1993)
Hughes, J.: Why Functional Programming Matters. Computer Journal 32(2), 98–107 (1989)
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)
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)
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)
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)
Jones, S.L.P., Hughes, J., et al.: Haskell 98: A non-strict, purely functional language (February 1999), http://www.haskell.org
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)
Jones, S.L.P., Marlow, S.: Secrets of the Glasgow Haskell compiler inliner. In: IDL 1999 (1999), http://www.binnetcorp.com/wshops/IDL99.html
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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