Chacha.put: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha.bend as Chacha Lines 25-30 of bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha.bend&start_line=25&end_line=30 import Base # The list with element i replaced (unchanged past its end). def put(xs: List<&2, U32>, i: Nat, y: U32) -> List<&2, U32>: match xs i: case Nil{} _: Nil{} case x <> rest 0n: y <> rest case x <> rest 1n+p: x <> put(rest, p, y) Uses (3): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32