skipDuplicates<A> static method

Conveyor<From<A>, A> skipDuplicates<A>([
  1. Eq<A>? _eq
])

Implementation

static Conveyor<From<A>, A> skipDuplicates<A>([Eq<A>? _eq]) {
  final Eq<A> eq = _eq ?? objectEq();
  Conveyor<From<A>, A> loop(A lastA) => consume((A a) => eq.eq(lastA, a) ? loop(lastA) : produce(a, loop(a)));
  return consume((A a) => produce(a, loop(a)));
}