triples<L, M, R> method

Iterable<Triple<L, M, R>> triples<L, M, R>()

Creates an Iterable of Triples from an Iterable of lists. Each list should contain 3 values.

Implementation

Iterable<Triple<L, M, R>> triples<L, M, R>() sync* {
  for (final iterable in this) {
    if (iterable.length == 3) {
      yield Triple<L, M, R>(iterable.elementAt(0), iterable.elementAt(1), iterable.elementAt(2));

    } else {
      throw ArgumentError.value(iterable, 'Triple has a length of: ${iterable.length}, should be 3');
    }
  }
}