concept enumerator in category functional programming

appears as: Enumerators, enumerator, Enumerator
Grokking Functional Programming

This is an excerpt from Manning's book Grokking Functional Programming.

If we can have many enumerators, what’s the algorithm the compiler uses to figure out the result type of the whole for comprehension? The answer is pretty straight forward. The result type is a List, and the type of its elements is defined by expression after yield. In the code snippet above, the type of the whole expression is the List with elements of type returned by function(a, b, ..., z). Note that expressions as, bs, ..., zs must all be Lists in order to be accepted by the compiler. Here’s an example: