def get
import bend-collections@1.0.0.0/spec/crypto/chacha.bend as Chachaimport Base
18# Element i of a list, 0 past its end.
19def get(xs: List<&2, U32>, i: Nat) -> U32:
20 match xs i:
21 case Nil{} _: 0
22 case x <> rest 0n: x
23 case x <> rest 1n+p: get(rest, p)