It took us three chapters to get to the moment where we're ready to discuss the origins of the flatMap method in regards to the effects we looked at in Chapter 6, Exploring Built-In Effects. The reason for this is not the complexity of the topic, but the richness of the family of abstractions related to it.
After this introduction, a suspicious reader will think with disappointment—OK, now they are going to use their usual trick and say that there is an abstraction for flatMap, flattener or flatMapative, pull some laws out of thin air, and consider themselves done. What cheaters!
Well, technically we're not cheating because we're not pulling things out of anywhere. Instead, we're taking them from category theory, the branch of mathematics we mentioned previously. The rules our abstractions must obey are defined by mathematicians...