Bytes.to_list.go: def of lawful-bytes@0.1.1.0 Import: import lawful-bytes@0.1.1.0/bytes.bend as Bytes Lines 178-187 of lawful-bytes@0.1.1.0/bytes.bend: https://jend.leeeet.dev/read.txt?path=lawful-bytes@0.1.1.0/bytes.bend&start_line=178&end_line=187 import Base import lawful-bytes@0.1.1.0/defs.bend as D # n more bytes put in front of acc, from byte j down; r holds byte j. A tail # call, so the loop runs in constant stack. def to_list.go(n: Nat, r: D.Bytes & U32, +j: U32, acc: List<&2, U32>) -> D.Bytes & List<&2, U32>: match n: case 0n: (b, x) = r (b, acc) case 1n+m: (b, +x) = r to_list.go(m, at(b, (j - 1 : U32)), (j - 1 : U32), Con{x, acc}) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List 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.sub https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/bytes.bend&name=at https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/defs.bend&name=Bytes