cartesian<U> method
Cartesian product: all pairs (a, b) for a in this, b in other.
Implementation
@useResult
Iterable<(T, U)> cartesian<U>(Iterable<U> other) sync* {
final List<T> thisList = toList();
final List<U> otherList = other.toList();
for (final T a in thisList) {
for (final U b in otherList) {
yield (a, b);
}
}
}