Skip to main content

An Expression Processor: A Case Study in Refactoring Haskell Programs

  • Conference paper
Trends in Functional Programming (TFP 2010)

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

Included in the following conference series:

Abstract

Refactoring is the process of changing the structure of a program while preserving its behaviour in order to increase code quality, programming productivity and code reuse. With the advent of refactoring tools, refactoring can be performed semi-automatically, allowing refactorings to be performed (and undone) easily.

In this paper, we briefly describe a number of new refactorings for Haskell 98 programs implemented in the Haskell Refactorer, HaRe. In particular, a number of new structural and data-type refactorings are presented. We also implement a simple expression processor, clearly demonstrating how the refactorings and the HaRe tool can aid programmers in developing Haskell software. We conclude the paper with a discussion of the benefits of refactoring Haskell programs, together with their implementation and design limitations.

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 54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.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. Brooks, F.P.: The Mythical Man-Month: After 20 Years. IEEE Software 12(5), 57–60 (1995)

    Article  Google Scholar 

  2. Opdyke, W.F.: Refactoring Object-Oriented Frameworks. PhD thesis, Department of Computer Science, University of Illinois at Urbana-Champaign, Champaign, IL, USA (1992)

    Google Scholar 

  3. Burstall, R.M., Darlington, J.: A Transformation System for Developing Recursive Programs. J. ACM 24(1), 44–67 (1977)

    Article  MathSciNet  MATH  Google Scholar 

  4. Li, H., Thompson, S., Reinke, C.: The Haskell Refactorer, HaRe, and its API. Electronic Notes in Theoretical Computer Science 141(4), 29–34 (2005); Proceedings of the Fifth Workshop on Language Descriptions, Tools, and Applications (LDTA 2005)

    Article  Google Scholar 

  5. Li, H., Reinke, C., Thompson, S.: Tool Support for Refactoring Functional Programs. In: ACM SIGPLAN 2003 Haskell Workshop, Association for Computing Machinery, pp. 27–38 (August 2003)

    Google Scholar 

  6. Peyton Jones, S., Hammond, K.: Haskell 98 Language and Libraries, the Revised Report. Cambridge University Press, Cambridge (2003)

    MATH  Google Scholar 

  7. Refactor-fp Group, T.: The Haskell Editing Survey (2004), http://www.cs.kent.ac.uk/projects/refactor-fp/surveys/haskell-editors-July-2002.txt

  8. Oualine, S.: Vim (Vi Improved). Sams (April 2001)

    Google Scholar 

  9. Cameron, D., Elliott, J., Loy, M.: Learning GNU Emacs. O’Reilly, Sebastopol (2004)

    Google Scholar 

  10. Hallgren, T.: Haskell Tools from the Programatica Project. In: Haskell 2003: Proceedings of the 2003 ACM SIGPLAN Workshop on Haskell, pp. 103–106. ACM Press, New York (2003)

    Google Scholar 

  11. Lämmel, R., Visser, J.: A Strafunski Application Letter. In: Dahl, V. (ed.) PADL 2003. LNCS, vol. 2562, pp. 357–375. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  12. Li, H.: Refactoring Haskell Programs. PhD thesis, School of Computing, University of Kent, Canterbury, Kent, UK (September 2006)

    Google Scholar 

  13. Brown, C.: Tool Support for Refactoring Haskell Programs. PhD thesis, School of Computing, University of Kent, Canterbury, Kent, UK (September 2008), http://www.cs.kent.ac.uk/projects/refactor-fp/publications/ChrisThesis.pdf

  14. Brown, C., Thompson, S.: Clone Detection and Elimination for Haskell. In: Gallagher, J., Voigtlander, J. (eds.) PEPM 2010: Proceedings of the 2010 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, pp. 111–120. ACM Press, New York (2010)

    Chapter  Google Scholar 

  15. Refactor-fp Group, T.: Refactoring Functional Programs (2008), http://www.cs.kent.ac.uk/projects/refactor-fp

  16. Pettorossi, A.: A Powerful Strategy for Deriving Efficient Programs by Transformation. In: LFP 1984: Proceedings of the 1984 ACM Symposium on LISP and Functional Programming, pp. 273–281. ACM, New York (1984)

    Chapter  Google Scholar 

  17. Brown, C., Thompson, S.: Expression processor example code (2010), http://www.cs.st-and.ac.uk/~chrisb/tfp2010.html

  18. Partsch, H., Steinbruggen, R.: Program Transformation Systems. ACM Comput. Surv. 15(3), 199–236 (1983)

    Article  MathSciNet  Google Scholar 

  19. Hudak, P.: Conception, Evolution, and Application of Functional Programming Languages. ACM Computing Survey 21(3), 359–411 (1989)

    Article  Google Scholar 

  20. Mens, T., Tourwé, T.: A Survey of Software Refactoring. IEEE Trans. Softw. Eng. 30(2), 126–139 (2004)

    Article  Google Scholar 

  21. Kozsik, T., Csörnyei, Z., Horváth, Z., Király, R., Kitlei, R., Lövei, L., Nagy, T., Tóth, M., Víg, A.: Use cases for refactoring in erlang. In: Horváth, Z., Plasmeijer, R., Soós, A., Zsók, V. (eds.) Central European Functional Programming School. LNCS, vol. 5161, pp. 250–285. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  22. Mattsson, H., Nilsson, H., Wikström, C., Ericsson Telecom Ab: Mnesia – A distributed robust DBMS for telecommunications applications. In: Gupta, G. (ed.) PADL 1999. LNCS, vol. 1551, pp. 152–163. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  23. Gill, A.: Introducing the Haskell Equational Reasoning Assistant. In: Proceedings of the 2006 ACM SIGPLAN Workshop on Haskell, pp. 108–109. ACM Press, New York (2006)

    Chapter  Google Scholar 

  24. Thompson, S.: Higher-order + Polymorphic = Reusable (May 1997)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Brown, C., Li, H., Thompson, S. (2011). An Expression Processor: A Case Study in Refactoring Haskell Programs. In: Page, R., Horváth, Z., Zsók, V. (eds) Trends in Functional Programming. TFP 2010. Lecture Notes in Computer Science, vol 6546. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-22941-1_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-22941-1_3

  • Publisher Name: Springer, Berlin, Heidelberg

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

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

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics