def update

bend-collections@1.0.0.0 · spec/lib/common.bend:80

import bend-collections@1.0.0.0/spec/lib/common.bend as Common
import 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 (0)

No other definition uses this definition.