zip<S, T> function

List<Tuple2<S, T>> zip<S, T>(
  1. Iterable<S> ss,
  2. Iterable<T> ts
)

Implementation

List<Tuple2<S, T>> zip<S, T>(Iterable<S> ss, Iterable<T> ts) {
  if (ss.isEmpty || ts.isEmpty) return [];
  return [Tuple2(ss.first, ts.first), ...(zip(ss.skip(1), ts.skip(1)))];
}