Skip to main content

Pull-Ups, Push-Downs, and Passing It Around

Exercises in Functional Incrementalization

  • Conference paper
Implementation and Application of Functional Languages (IFL 2009)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 6041))

Abstract

Programs in languages such as Haskell are often datatype-centric and make extensive use of folds on that datatype. Incrementalization of such a program can significantly improve its performance by transforming monolithic atomic folds into incremental computations. Functional incrementalization separates the recursion from the application of the algebra in order to reduce redundant computations and reuse intermediate results. In this paper, we motivate incrementalization with a simple example and present a library for transforming programs using upwards, downwards, and circular incrementalization. Our benchmarks show that incrementalized computations using the library are nearly as fast as handwritten atomic functions.

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. Chakravarty, M.M.T., Keller, G., Peyton Jones, S.L., Marlow, S.: Associated Types with Class. In: POPL, pp. 1–13 (2005)

    Google Scholar 

  2. Hinze, R., Jeuring, J., Löh, A.: Type-indexed data types. Science of Computer Programming 51(1-2), 117–151 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  3. Sheard, T., Peyton Jones, S.L.: Template Meta-programming for Haskell. In: Haskell, pp. 1–16 (2002)

    Google Scholar 

  4. Liu, Y.A.: Efficiency by Incrementalization: An Introduction. Higher-Order and Symbolic Computation 13(4), 289–313 (2000)

    Article  MathSciNet  Google Scholar 

  5. Adams, S.: Functional Pearls: Efficient sets – a balancing act. J. of Functional Programming 3(04), 553–561 (1993)

    Article  Google Scholar 

  6. Claessen, K., Hughes, J.: QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In: ICFP, pp. 268–279 (2000)

    Google Scholar 

  7. Knuth, D.E.: Semantics of context-free languages. Theory of Computing Systems 2(2), 127–145 (1968)

    MathSciNet  MATH  Google Scholar 

  8. Gibbons, J.: Upwards and downwards accumulations on trees. In: Bird, R.S., Woodcock, J.C.P., Morgan, C.C. (eds.) MPC 1992. LNCS, vol. 669, pp. 122–138. Springer, Heidelberg (1993)

    Chapter  Google Scholar 

  9. Huet, G.: The Zipper. J. of Functional Programming 7(05), 549–554 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  10. Bird, R.S.: Using Circular Programs to Eliminate Multiple Traversals of Data. Acta Informatica 21(3), 239–250 (1984)

    Article  MATH  Google Scholar 

  11. Swierstra, W.: Why Attribute Grammars Matter. The Monad .Reader 4 (2005)

    Google Scholar 

  12. Peyton Jones, S.L., Marlow, S., Elliott, C.: Stretching the storage manager: weak pointers and stable names in Haskell. In: Mohnen, M., Koopman, P. (eds.) IFL 2000. LNCS, vol. 2011, pp. 37–58. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  13. Hinze, R.: Memo functions, polytypically! In: Jeuring, J. (ed.) WGP (2000)

    Google Scholar 

  14. van Noort, T., Rodriguez Yakushev, A., Holdermans, S., Jeuring, J., Heeren, B.: A lightweight approach to datatype-generic rewriting. In: WGP, pp. 13–24 (2008)

    Google Scholar 

  15. Rodriguez Yakushev, A., Holdermans, S., Löh, A., Jeuring, J.: Generic Programming with Fixed Points for Mutually Recursive Datatypes. In: ICFP, pp. 233–244 (2009)

    Google Scholar 

  16. Leather, S., Löh, A., Jeuring, J.: Pull-Ups, Push-Downs, and Passing It Around: Exercises in Functional Incrementalization. Technical Report UU-CS-2009-024, Dept. of Information and Computing Sciences, Utrecht University (November 2009)

    Google Scholar 

  17. Fokkinga, M.M., Jeuring, J., Meertens, L., Meijer, E.: A Translation from Attribute Grammars to Catamorphisms. The Squiggolist 2(1), 20–26 (1991)

    Google Scholar 

  18. Saraiva, J., Swierstra, S.D., Kuiper, M.: Functional Incremental Attribute Evaluation. In: Watt, D.A. (ed.) CC 2000. LNCS, vol. 1781, pp. 279–294. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  19. Viera, M., Swierstra, S.D., Swierstra, W.: Attribute Grammars Fly First-Class: How to do Aspect Oriented Programming in Haskell. In: ICFP, pp. 245–256 (2009)

    Google Scholar 

  20. Jeuring, J.: Incremental algorithms on lists. In: van Leeuwen, J. (ed.) SION Conference on Computer Science in the Netherlands, pp. 315–335 (1991)

    Google Scholar 

  21. Carlsson, M.: Monads for incremental computing. In: ICFP, pp. 26–35 (2002)

    Google Scholar 

  22. Acar, U.A., Blelloch, G.E., Harper, R.: Adaptive functional programming. In: POPL, pp. 247–259 (2002)

    Google Scholar 

  23. Bernardy, J.P.: Lazy Functional Incremental Parsing. In: Haskell, pp. 49–60 (2009)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Leather, S., Löh, A., Jeuring, J. (2010). Pull-Ups, Push-Downs, and Passing It Around. In: Morazán, M.T., Scholz, SB. (eds) Implementation and Application of Functional Languages. IFL 2009. Lecture Notes in Computer Science, vol 6041. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-16478-1_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-16478-1_10

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-16477-4

  • Online ISBN: 978-3-642-16478-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics