Chapter 5. Functional programming

This chapter covers

  • Why functional programming matters
  • Mixing functional programming with OOP
  • Functions in various forms
  • Monads and their practical examples

You’re already doing functional programming using Scala if you’ve been following the examples in the book. In some cases it’s explicitly mentioned or visible and in other cases it’s mixed with object-oriented constructs of the Scala language. This chapter focuses on functional programming concepts and how they can be implemented in Scala. The goal of the chapter is to make you comfortable with functional programming and help you to write code in functional programming style.

Functional programming is a programming paradigm that models computation ...

Get Scala in Action now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.