Slide 17 of 41
Notes:
Monoid comprehensions are based on the notion of monoid homomorphisms from abstract algebra. A monoid homomorphism is from a collection monoid to any monoid. It maps the zero element of the input monoid to the zero of the output monoid, it replaces the unit function with function f, and it distributes over merge. For example, the homomorphism from the set monoid to the + monoid applies f to every element of the set and adds together the results.