def nth
import bend-kit-zlib@0.5.1.0/zlib.bend as Zlibimport Base
44def nth(xs: List<&2, U32>, +i: U32) -> U32:
45 match xs:
46 case Nil{}:
47 0
48 case Con{h, t}:
49 Bool.pick(U32, U32.is_zero(i), h, nth(t, (i - 1 : U32)))
import bend-kit-zlib@0.5.1.0/zlib.bend as Zlibimport Base
44def nth(xs: List<&2, U32>, +i: U32) -> U32:
45 match xs:
46 case Nil{}:
47 0
48 case Con{h, t}:
49 Bool.pick(U32, U32.is_zero(i), h, nth(t, (i - 1 : U32)))