September 2018
Intermediate to advanced
398 pages
9h 43m
English
The documentation mentions a very important point: the instances of the type class must implement an associative combine function.
This means that they must verify the following law:
a combine (b combine c) = (a combine b) combine c
Most type classes in Cats have their own specific laws. The library guarantees that the type class instances that it defines verify this law. However, if you implement your own instance of a type class, it is your responsibility to verify that it does not break any law.
A user of a type class instance expects that it verifies all of the laws of the type class; it is part of the type class’s contract.
When a type class verifies certain laws, you ...
Read now
Unlock full access