cartesianSelect4<T2, T3, T4, TResult> method

Iterable<TResult> cartesianSelect4<T2, T3, T4, TResult>(
  1. Iterable<T2> o2,
  2. Iterable<T3> o3,
  3. Iterable<T4> o4,
  4. TResult selector(
    1. T element,
    2. T2 o2Element,
    3. T3 o3Element,
    4. T4 o4Element,
    ),
)

Generates the cartesian product of this iterable and three other iterables, returning an iterable of mapped elements.

Generates all the elements in the cartesian product between this and the provided iterables. The resulting iterable will consist of an iterable with each combination of each element from this iterable and each element from each other iterable after being passed through the selector function.

Implementation

Iterable<TResult> cartesianSelect4<T2, T3, T4, TResult>(
  Iterable<T2> o2,
  Iterable<T3> o3,
  Iterable<T4> o4,
  TResult Function(T element, T2 o2Element, T3 o3Element, T4 o4Element)
      selector,
) sync* {
  for (var a in this) {
    for (var b in o2) {
      for (var c in o3) {
        for (var d in o4) {
          yield selector(a, b, c, d);
        }
      }
    }
  }
}