crossAllWith<T, R> function
Returns the homogeneous N-way Cartesian product of iterables mapped
through reduce.
Implementation
List<R> crossAllWith<T, R>(
Iterable<Iterable<T>> iterables,
R Function(List<T> tuple) reduce,
) {
final tuples = crossAll<T>(iterables);
return <R>[for (final tuple in tuples) reduce(tuple)];
}