Chapter 19. Functional programming techniques

This chapter covers

  • First-class citizens, higher-order functions, currying, and partial application
  • Persistent data structures
  • Lazy evaluation and lazy lists as generalizing Java streams
  • Pattern matching and how to simulate it in Java
  • Referential transparency and caching

In chapter 18, you saw how to think functionally; thinking in terms of side-effect-free methods can help you write more maintainable code. In this chapter, we introduce more advanced functional programming techniques. You can view this chapter as being a mix of practical techniques to apply in your code base, as well as academic information that will make you a more knowledgeable programmer. We discuss higher-order functions, ...

Get Modern Java in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.