zip<T, E> function

Iterable<Tuple<T, E>> zip<T, E>(
  1. List<T> lhs,
  2. List<E> rhs
)

Implementation

Iterable<Tuple<T, E>> zip<T, E>(List<T> lhs, List<E> rhs) sync* {
  if (lhs.length != rhs.length) {
    throw ArgumentError('length of lists should be equal');
  }
  for (var i = 0; i < lhs.length; i++) {
    yield Tuple(lhs[i], rhs[i]);
  }
}