def update
import bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend as Commonimport Base
80# Replace element i (no change when i is out of range).
81def update(-A: Data, xs: List<&2, A>, i: Nat, x: A) -> List<&2, A>:
82 match xs i:
83 case Nil{} _:
84 Nil{}
85 case Con{h, t} 0n:
86 Con{x, t}
87 case Con{h, t} 1n+p:
88 Con{h, update(A, t, p, x)}
Uses (2)
Used by (21)
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/argon2/memory:splice
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/argon2/argon2:set
- bend-collections-laws-crypto@1.0.0.0/proofs/lib/list:length_update
- bend-collections-laws-crypto@1.0.0.0/proofs/lib/array:upd_slots
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/argon2/memory:splice_app_left
- …