Dtype.read_u: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/dtype.bend as Dtype Lines 180-186 of bendtorch@1.3.0.0/dtype.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/dtype.bend&start_line=180&end_line=186 import Base # the k + 1 values from index i, in order (ra holds the array and the value at i, already read) def read_u(k: Nat, +i: U32, acc: List<&2, U32>, ra: Array & U32) -> UL: match k ra: case 0n Tuple{a, v}: UL{a, List.reverse(&2, U32, v <> acc)} case 1n+p Tuple{a, +v}: read_u(p, (i + 1 : U32), v <> acc, Array.get(U32, a, (i + 1 : U32))) 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=List.reverse 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 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/dtype.bend&name=UL