Since the idea of a type class is highly abstract, it is necessary to develop an understanding of what it is and how it can be used in practice.
Interpretation of the Type Class pattern
Injectable interfaces
One way to think about the Type Class pattern is as of a way of injecting entire interfaces into existing classes.
In ordinary imperative languages, interfaces facilitate polymorphism. They allow you to treat classes that exhibit similar behavior uniformly. So for example, if you have classes for a car, a motorcycle, and a truck, you can define an interface vehicle, and treat all these classes as instances of that interface. No longer do you care about the peculiarities of the implementations of each class, all you care...