def nth

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

import bend-collections-laws-crypto@1.0.0.0/src/math/random/rand.bend as Rand
import 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)

Uses (3)

Used by (6)