Remote / Totals over a loaded list

The six kinds, and what each gives

AggregatevalueWhen the list has no rows
Rows.sum(Row, $ => $.cents)a number0
Rows.count(Row)a number0
Rows.min(Row, $ => $.due)an Option of a numberOption.none()
Rows.max(Row, $ => $.due)an Option of a numberOption.none()
Rows.every(Row, $ => …)a booleantrue
Rows.any(Row, $ => …)a booleanfalse

Rows.count(Row, $ => …) counts only the rows a condition holds of. min and max give Option.none() also when no row has a value.

Rows.sum takes only whole-number contributions (a Schema.Int, Money or Decimal field, and +, -, * over them) and throws when you call Rows.sum, not later, for anything else: adding and taking away decimals drifts, so a total kept by differences would stop matching one added up afresh. min and max skip a null; a condition that cannot be decided (it reads a null) counts as false.

Row may name fewer fields than the list selects, but not a field it does not: an aggregate over tax on this list is a type error, since the list never decodes one.