Advertisement

Call Arity

  • Joachim Breitner
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8843)

Abstract

Higher order combinators in functional programming languages can lead to code that would be considerably more efficient if some functions’ definitions were eta-expanded, but the existing analyses are not always precise enough to allow that. In particular, this has prevented \( foldl \) from efficiently taking part in list fusion.

Call Arity is an analysis that eta-expands functions based on their uses, instead of their definitions, and is very precise in the presence of recursion. Its inclusion in GHC now allows to fuse \( foldl \)-based combinators.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Breitner, J.: The correctness of Launchbury’s natural semantics for lazy evaluation. Archive of Formal Proofs (January 2013) http://afp.sf.net/entries/Launchbury.shtml. Formal proof development
  2. 2.
    Coutts, D.: Stream Fusion: Practical shortcut fusion for coinductive sequence types. PhD thesis, University of Oxford (2010)Google Scholar
  3. 3.
    Coutts, D., Leshchinskiy, R., Stewart, D.: Stream fusion. from lists to streams to nothing at all. In: ICFP (2007)Google Scholar
  4. 4.
    Farmer, A., Höner zu Siederdissen, C., Gill, A.: The HERMIT in the Stream: Fusing Stream Fusion’s concatmap. In: PEPM (2014)Google Scholar
  5. 5.
    Gill, A.J.: Cheap deforestation for non-strict functional languages. PhD thesis, University of Glasgow (1996)Google Scholar
  6. 6.
    Hage, J., Holdermans, S., Middelkoop, A.: A generic usage analysis with subeffect qualifiers. In: ICFP, pp. 235–246 (2007)Google Scholar
  7. 7.
    Launchbury, J.: A natural semantics for lazy evaluation. In: POPL (1993)Google Scholar
  8. 8.
    Marlow, S., Peyton Jones, S.L.: Making a fast curry: push/enter vs. eval/apply for higher-order languages. Journal of Functional Programming 16(4–5), 415–449 (2006)CrossRefzbMATHMathSciNetGoogle Scholar
  9. 9.
    Partain, W.: The nofib benchmark suite of haskell programs. In: Functional Programming (1992)Google Scholar
  10. 10.
    Sergey, I., Vytiniotis, D., Peyton Jones, S.: Modular, Higher-order Cardinality Analysis in Theory and Practice. In: POPL (2014)Google Scholar
  11. 11.
    Svenningsson, J.: Shortcut fusion for accumulating parameters & zip-like functions. In: ICFP (2002)Google Scholar
  12. 12.
    Takano, A.: Worker-wrapper fusion. https://github.com/takano-akio/ww-fusion. Prototype
  13. 13.
    Xu, D.N., Peyton Jones, S.: Arity analysis (2005). Working NotesGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  1. 1.Karlsruhe Institute of TechnologyKarlsruheGermany

Personalised recommendations