def put

bend-collections-laws-math@1.0.0.0 · src/math/random/rand.bend:261

import bend-collections-laws-math@1.0.0.0/src/math/random/rand.bend as Rand
import Base

261def put(-A: Data, xs: List<&2, A>, i: Nat, x: A) -> List<&2, A>:
262  match xs i:
263    case Nil{} _:
264      Nil{}
265    case Con{h, t} 0n:
266      Con{x, t}
267    case Con{h, t} 1n+p:
268      Con{h, put(A, t, p, x)}

Uses (2)

Used by (4)