Skip to main content

Why Functional Programming Matters to Me

  • Chapter
The Beauty of Functional Code

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 8106))

Abstract

Functional programming advocates a style of programming in which the programmer seeks to find a sufficiently small, yet powerful, set of abstractions that capture an entire class of problems, and use these abstractions to solve a concrete problem. I illustrate this by means of a case study in which I implement the game Trax\(^{\raisebox{-0.6ex}{\tiny \texttrademark}}\). In this turn-based game two players attempt to create either a closed loop of a line of their own color, or make the line connect opposite ends of a tile set of some prescribed minimal dimensions. Trax\(^{\raisebox{-0.6ex}{\tiny \texttrademark}}\) is an attractive case because it has interesting computational problems, for which I use classical functional techniques, but also because it is a distributed multi-user application, for which I use the more recently developed iTask formalism.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 16.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. Turner, D.A.: Miranda: A non-strict functional language with polymorphic types. In: Jouannaud, J.-P. (ed.) FPCA 1985. LNCS, vol. 201, pp. 1–16. Springer, Heidelberg (1985)

    Chapter  Google Scholar 

  2. Turner, D.: An overview of Miranda. SIGPLAN Notices 21(12), 158–166 (1986)

    Article  Google Scholar 

  3. Barendregt, H., van Eekelen, M., Glauert, J., Kennaway, J., Plasmeijer, M., Sleep, M.: Term graph rewriting. In: de Bakker, J.W., Nijman, A.J., Treleaven, P.C. (eds.) PARLE 1987. LNCS, vol. 259, pp. 141–158. Springer, Heidelberg (1987)

    Chapter  Google Scholar 

  4. Barendregt, H., van Eekelen, M., Glauert, J., Kennaway, J., Plasmeijer, M., Sleep, M.: Towards an intermediate language based on graph rewriting. In: de Bakker, J.W., Nijman, A.J., Treleaven, P.C. (eds.) PARLE 1987. LNCS, vol. 259, pp. 159–175. Springer, Heidelberg (1987)

    Chapter  Google Scholar 

  5. Hughes, J.: Why functional programming matters. Computer Journal 32(2), 98–107 (1989)

    Article  MathSciNet  Google Scholar 

  6. Hinze, R.: A new approach to generic functional programming. In: Reps, T. (ed.) Proceedings of the 27th International Symposium on Principles of Programming Languages, POPL 2000, Boston, MA, USA, pp. 119–132. ACM Press (2000)

    Google Scholar 

  7. Alimarine, A.: Generic Functional Programming - Conceptual Design, Implementation and Applications. PhD thesis, Radboud University Nijmegen (2005) ISBN 3-540-67658-9

    Google Scholar 

  8. Plasmeijer, R., Achten, P., Koopman, P.: iTasks: executable specifications of interactive work flow systems for the web. In: Hinze, R., Ramsey, N. (eds.) Proceedings of the International Conference on Functional Programming, ICFP 2007, Freiburg, Germany, pp. 141–152. ACM Press (2007)

    Google Scholar 

  9. Plasmeijer, R., Lijnse, B., Michels, S., Achten, P., Koopman, P.: Task-Oriented Programming in a Pure Functional Language. In: Proceedings of the 2012 ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, PPDP 2012, Leuven, Belgium, pp. 195–206. ACM (September 2012)

    Google Scholar 

  10. Felleisen, M., Findler, R., Flatt, M., Krishnamurthi, S.: How to Design Programs, 2nd edn. MIT Press (2012), http://www.ccs.neu.edu/home/matthias/HtDP2e/

  11. Morazán, M.T.: Functional Video Games in the CS1 Classroom. In: Page, R., Horváth, Z., Zsók, V. (eds.) TFP 2010. LNCS, vol. 6546, pp. 166–183. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  12. Felleisen, M., Findler, R., Flatt, M., Krishnamurthi, S.: A Functional I/O System * or, Fun for Freshman Kids. In: Proceedings International Conference on Functional Programming, ICFP 2009, Edinburgh, Scotland, UK. ACM Press (2009)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Achten, P. (2013). Why Functional Programming Matters to Me. In: Achten, P., Koopman, P. (eds) The Beauty of Functional Code. Lecture Notes in Computer Science, vol 8106. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-40355-2_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-40355-2_7

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-40354-5

  • Online ISBN: 978-3-642-40355-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics