Scala
Big picture: type classes are ad-hoc polymorphism with laws. The numbered notes climb the hierarchy those classes form. The Cats notes are the same ideas as read from the book.
Reading order
- Type classes: a trait that declares behavior, plus the laws that behavior must obey.
- Monoids and semigroups: combining values, with and without an identity.
- Functors: mapping over a structure without changing the structure.
- Monads: sequencing dependent computations.
- Semigroupal and applicative: combining independent computations.
- Foldable and traverse: folding a structure, and traversing it with an effect.
- Hierarchy: how the sequencing type classes sit inside each other.
- Higher kinds: kinds, the types of types. This is the machinery under functors and everything above them.
- Selections: variance, and which instance the compiler picks when more than one applies.
Cats
The same concepts, from Scala with Cats, in the order the ideas build.
- Type classes
- Ad-hoc polymorphism
- Implicits: how Scala finds the instance.
- Monoids