def put

bend-collections-laws-crypto@1.0.0.0 · spec/math/random/chacha8rand.bend:45

import bend-collections-laws-crypto@1.0.0.0/spec/math/random/chacha8rand.bend as Chacha8rand
import Base

45def put(xs: List<&2, U32>, i: Nat, y: U32) -> List<&2, U32>:
46  match xs i:
47    case Nil{} _:
48      Nil{}
49    case Con{x, rest} 0n:
50      Con{y, rest}
51    case Con{x, rest} 1n+p:
52      Con{x, put(rest, p, y)}

Uses (3)

Used by (2)