Aggregating a collection of data items of a T type means using all collection elements to create an instance of a new type, M, by applying a recursion rule to a current partial result and to each element of the collection. Each time the recursion rule is applied to an element of the collection and to the current partial result, a new partial result is obtained. At the end of the process, the last partial result becomes the result of the aggregation.
Examples of aggregations are computing the total value of an array of invoices, or finding the person whose surname-name pair comes first in lexicographical order.
Since the types involved are two (T and M) variable types, the aggregation function ...