Common type classes
In a typical project, you will not create many of your own type classes. Since type classes capture behaviors that are common across several types, it is likely that someone else has already implemented a type class similar to what you need, located in a library. It is usually more productive to reuse type classes defined in the SDK (or in third-party libraries) than to try and define your own.
In general, these libraries define predefined instances of a type class for the SDK types (String, Int, Option, and so on). You would typically reuse these instances to derive instances for your own types.
In this section, we will present the type classes that you are most likely to encounter, and how to use them to solve day-to-day ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access