def shift
import lawful-bytes@0.1.1.0/bytes.bend as Bytesimport Base
import lawful-bytes@0.1.1.0/defs.bend as D
161# The first k bytes dropped, the rest moved to the start (for k <= len).
162def shift(b: D.Bytes, +k: U32) -> D.Bytes:
163 D.Bytes{+n, buf} = b
164 truncate(shift.go(Nat.sub(U32.to_nat(n), U32.to_nat(k)), at(D.Bytes{n, buf}, k), 0, k), (n - k : U32))