crossAllWith<T, R> function

List<R> crossAllWith<T, R>(
  1. Iterable<Iterable<T>> iterables,
  2. R reduce(
    1. List<T> tuple
    )
)

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)];
}