def shift.go
import lawful-bytes@0.1.1.0/bytes.bend as Bytesimport Base
import lawful-bytes@0.1.1.0/defs.bend as D
151# Bytes j + k onwards moved to j; r holds byte j + k.
152def shift.go(n: Nat, r: D.Bytes & U32, +j: U32, +k: U32) -> D.Bytes:
153 match n:
154 case 0n:
155 (b, x) = r
156 b
157 case 1n+m:
158 (b, +x) = r
159 shift.go(m, at(set(b, j, x), ((j + 1 : U32) + k : U32)), (j + 1 : U32), k)