Chapter 7. Functional Idioms
In the previous chapter, we covered implicit parameters and implicit conversions. We saw how to enable elegant extension methods for your code. We also had a look at how the Scala compiler resolves implicits. Finally, we covered how implicits work, how to use them, and what kind of benefits they provide.
In this chapter, we'll cover the core
concepts of functional programming like
Pure
functions, immutability, and higher-order functions. We'll build upon this understanding and introduce some of the design patterns that are prevalent in large functional programs that you'll no doubt run into once you start to use Scala libraries that focus on functional programming. Finally, we'll cover two popular functional programming libraries called
Cats
and
Doobie
, and use them to write some interesting programs.
Functional programming languages have been around for a very long time, but they have gotten more traction lately, with functional programming concepts being...