window<A> static method

Conveyor<From<A>, IVector<A>> window<A>(
  1. int n
)

Implementation

static Conveyor<From<A>, IVector<A>> window<A>(int n) => Pipe.scan(emptyVector<A>(), (IVector<A> v, A i) => v.length() >= n ? v.dropFirst().appendElement(i) : v.appendElement(i));