Common.update: def of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/spec/lib/common.bend as Common Lines 80-88 of bend-collections-laws-math@1.0.0.0/spec/lib/common.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/spec/lib/common.bend&start_line=80&end_line=88 import Base # Replace element i (no change when i is out of range). def update(-A: Data, xs: List<&2, A>, i: Nat, x: A) -> List<&2, A>: match xs i: case Nil{} _: Nil{} case Con{h, t} 0n: Con{x, t} case Con{h, t} 1n+p: Con{h, update(A, t, p, x)} Uses (2): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat