Slide 18 of 41
Notes:
A monoid comprehension is defined in terms of monoid homomorphisms. The qualifiers are translated from left to right. At the end we get a comprehension that has no qualifiers. This is equivalent to the application of the unit function to the head of the comprehension (or is just the head for primitive monoids). If the leftmost qualifier is a generator, it is translated into a homomorphism; otherwise, if it is a predicate, it is translated into an if-then-else. For example, a comprehension with two generators is translated into a nested homomorphism.