Skip to main content

Typed Combinators for Generic Traversal

  • Conference paper
  • First Online:
Practical Aspects of Declarative Languages (PADL 2002)

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

Included in the following conference series:

Abstract

Lacking support for generic traversal, functional programming languages suffer from a scalability problem when applied to largescale program transformation problems. As a solution, we introduce functional strategies: typeful generic functions that not only can be applied to terms of any type, but which also allow generic traversal into subterms. We show how strategies are modelled inside a functional language, and we present a combinator library including generic traversal combinators. We illustrate our technique of programming with functional strategies by an implementation of the extract method refactoring for Java.

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. M. Abadi, L. Cardelli, B. Pierce, and G. Plotkin. Dynamic Typing in a Statically Typed Language. ACM Transactions on Programming Languages and Systems, 13(2):237–268, Apr. 1991.

    Article  Google Scholar 

  2. G. Arango, I. Baxter, P. Freeman, and C. Pidgeon. TMM: Software maintenance by transformation. IEEE Software, 3(3):27–39, May 1986.

    Article  Google Scholar 

  3. M. Brand, M. Sellink, and C. Verhoef. Generation of Components for Software Renovation Factories from Context-free Grammars. Science of Computer Programming, 36(2–3):209–266, 2000.

    Article  Google Scholar 

  4. E. Chikofsky and J. C. II. Reverse Engineering and Design Recovery: A Taxonomy. IEEE Software, 7(1):13–17, Jan. 1990.

    Article  Google Scholar 

  5. K. Crary, S. Weirich, and G. Morrisett. Intensional polymorphism in type-erasure semantics. ACM SIGPLAN Notices, 34(1):301–312, Jan. 1999.

    Article  Google Scholar 

  6. A. Deursen, P. Klint, and C. Verhoef. Research Issues in the Renovation of Legacy Systems. In J. Finance, editor, Proc. of FASE’99, volume 1577 of LNCS, pages 1–21. Springer-Verlag, 1999.

    Google Scholar 

  7. C. Dubois, F. Rouaix, and P. Weis. Extensional polymorphism. In Conference record of POPL’95, pages 118–129. ACM Press, 1995.

    Google Scholar 

  8. P. H. Eidor., F. Henglein, C. Mossin, H. Niss, M. H. B. Sørensen, and M. Tofte. AnnoDomini: From type theory to year 2000 conversion tool. In Conference Record of POPL’99, pages 1–14. ACM press, 1999. Invited paper.

    Google Scholar 

  9. M. Fowler. Refactoring: Improving the Design of Existing Code. Addison Wesley, 1999.

    Google Scholar 

  10. Haskell 98: A Non-strict, Purely Functional Language, Feb. 1999. http://www.haskell.org/onlinereport/.

  11. R. Hinze. A generic programming extension for Haskell. In E. Meijer, editor, Proceedings of the 3rd Haskell Workshop, Paris, France, Sept. 1999. Technical report, Universiteit Utrecht, UU-CS-1999-28.

    Google Scholar 

  12. P. Jansson and J. Jeuring. PolyP-a polytypic programming language extension. In Conference record of POPL’97, pages 470–482. ACM Press, 1997.

    Google Scholar 

  13. J. Jeuring, editor. Proc. of WGP’2000, Technical Report, Universiteit Utrecht, July 2000.

    Google Scholar 

  14. M. Jones. First-class polymorphism with type inference. In Conference record of POPL’97, pages 483–496, Paris, France, 15-17 Jan. 1997.

    Google Scholar 

  15. J. Kort, R. Lämmel, and J. Visser. Functional Transformation Systems. In 9th International Workshop on Functional and Logic Programming, Benicassim, Spain, July 2000.

    Google Scholar 

  16. R. Lämmel. Typed Generic Traversals in S 1 ?. Technical Report SEN-R0122, CWI, Aug. 2001.

    Google Scholar 

  17. R. Lämmel, J. Visser, and J. Kort. Dealing with Large Bananas. In Jeuring [13], pages 46–59.

    Google Scholar 

  18. L. Paulson. A Higher-Order Implementation of Rewriting. Science of Computer Programming, 3(2):119–149, Aug. 1983.

    Article  MATH  MathSciNet  Google Scholar 

  19. E. Visser. Language Independent Traversals for Program Transformation. In Jeuring [13], pages 86–104.

    Google Scholar 

  20. E. Visser, Z. Benaissa, and A. Tolmach. Building Program Optimizers with Rewriting Strategies. In Proc. of ICFP’98, pages 13–26, Sept. 1998.

    Google Scholar 

  21. P. Wadler. Theorems for Free! In Proc. of FPCA’89, London, pages 347–359. ACM Press, New York, Sept. 1989.

    Google Scholar 

  22. P. Wadler. The essence of functional programming. In Conference record of POPL’92, pages 1–14. ACM Press, 1992.

    Google Scholar 

  23. M. Wallace and C. Runciman. Haskell and XML: Generic combinators or typebased translation? ACM SIGPLAN Notices, 34(9):148–159, Sept. 1999. Proceedings of ICFP’99.

    Article  Google Scholar 

  24. S. Weirich. Type-safe cast: (functional pearl). ACM SIGPLAN Notices, 35(9):58–67, Sept. 2000.

    Article  Google Scholar 

  25. N. Winstanley. Derive User Guide, version 1.0. Available at http://www.dcs.gla.ac.uk/~nww/Derive/, June 1997.

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Lämmel, R., Visser, J. (2002). Typed Combinators for Generic Traversal. In: Krishnamurthi, S., Ramakrishnan, C.R. (eds) Practical Aspects of Declarative Languages. PADL 2002. Lecture Notes in Computer Science, vol 2257. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45587-6_10

Download citation

  • DOI: https://doi.org/10.1007/3-540-45587-6_10

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-43092-6

  • Online ISBN: 978-3-540-45587-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics