In this chapter, you will learn about concepts that are built on top of Scala. The concepts in this chapter will be abstract, and they will require some concentration to understand; do not feel bad if you do not get it right away. Each individual part is relatively easy to understand, but when you put them all together, things can get complicated.
We will be focusing on type classes, with a definition for each one. They will be followed by an example illustrating how type classes can be useful in typical programs. As these concepts can be difficult, we also suggest some optional exercises that can strengthen your understanding. You do not have to do them to be able to follow the rest of the chapter. The solutions to the exercises are available on GitHub.
The majority of type classes presented here come from a library called Cats, created by Typelevel.
In this chapter...