filterIterable = (baseIterable, pred) =>
  /** @type {Iterable<U>} */
  Far('filtered iterable', {
    [Symbol.iterator]: () => {
      const baseIterator = baseIterable[Symbol.iterator]();
      return Far('filtered iterator', {
        next: () => {
          for (;;) {
            const result = baseIterator.next();
            const { value, done } = result;
            if (done || pred(value)) {
              return result;
            }
          }
        },
      });
    },
  })
The result iterator has a subset of the non-final values from the
`baseIterator` --- those for which `pred(value)` was truthy. The result
has the same termination as the `baseIterator` -- the same completion value
or failure reason.

@template T
@param {Iterable<T>} baseIterable
@param {(value: T) => boolean} pred
@returns {Iterable<T>}