mapIterator = (iterator, f) => ({
  /**
   * @param {function(T):R} f
   */
  [Symbol.iterator]() {
    return this;
  },

  // @ts-ignore
  next() {
    const r = iterator.next();
    return {
      value: r.done ? undefined : f(r.value),
      done: r.done
    };
  }

})
@template T,R
@param {Iterator<T>} iterator
@param {function(T):R} f
@return {IterableIterator<R>}