def Vec.to_list.go
import bend-kit-collections@0.1.4.1/vec.bend as Vecimport Base
108def Vec.to_list.go(
109 ~T: Data, fuel: Nat, +i: U32, acc: List<&2, T>, r: Array<T> & T
110) -> List<&2, T>:
111 match fuel:
112 case 0n:
113 acc
114 case 1n+p:
115 (buf, x) = r
116 +j = (i - 1 : U32)
117 Vec.to_list.go(~T, p, j, x <> acc, Array.get(T, buf, j))