shiftRight method

Iterable<T> shiftRight([
  1. int count = 1
])

shifts right by count

Implementation

Iterable<T> shiftRight([int count = 1]) {
  if (count < 0) {
    return shiftLeft(count.abs());
  }
  if (count.isZero) {
    return [...this];
  }
  // allow circular shift
  final c = count % length;

  return skip(length - c).followedBy(take(length - c));
}