def nth
import bend-collections@1.0.0.0/src/math/random/rand.bend as Randimport Base
252def nth(-A: Data, xs: List<&2, A>, i: Nat) -> Maybe<&2, A>:
253 match xs i:
254 case Nil{} _:
255 None{}
256 case Con{h, t} 0n:
257 Some{h}
258 case Con{h, t} 1n+p:
259 nth(A, t, p)