def at
import bend-kit-archive@0.5.1.0/archive.bend as Archiveimport Base
44def at(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, at(t, (i - 1 : U32)))
import bend-kit-archive@0.5.1.0/archive.bend as Archiveimport Base
44def at(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, at(t, (i - 1 : U32)))