DynamicArray.tl_go_at: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/containers/dynamic_array.bend as DynamicArray Lines 440-447 of bend-collections@1.0.0.0/src/containers/dynamic_array.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/containers/dynamic_array.bend&start_line=440&end_line=447 import Base # The executable to_list is the same indexed walk, compiled at a closed # element type; proofs/dynamic_array/closed.bend proves the two agree. def tl_go_at(~T: Data, k: Nat, acc: List<&2, T>, r: Array> & Maybe<&2, T>) -> Array> & List<&2, T>: match k r: case 0n Tuple{a, x}: (a, acc) case 1n+ +m Tuple{a, x}: tl_go_at(~T, m, cons_some(T, x, acc), Array.get(Maybe<&2, T>, a, U32.from_nat(dec1(m)))) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.get https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/dynamic_array.bend&name=cons_some https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/dynamic_array.bend&name=dec1