def nth
import bend-collections@1.0.0.0/spec/lib/common.bend as Commonimport Base
70# Element i, if any.
71def nth(-A: Data, xs: List<&2, A>, i: Nat) -> Maybe<&2, A>:
72 match xs i:
73 case Nil{} _:
74 None{}
75 case Con{h, t} 0n:
76 Some{h}
77 case Con{h, t} 1n+p:
78 nth(A, t, p)
Uses (3)
Used by (0)
No other definition uses this definition.