Random.shuffle.read: def of bend-kit-random@0.1.0.1 Import: import bend-kit-random@0.1.0.1/random.bend as Random Lines 121-129 of bend-kit-random@0.1.0.1/random.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-random@0.1.0.1/random.bend&start_line=121&end_line=129 import Base # Slots [0, k] of the array, with ax the read of slot k, prepended to acc. def shuffle.read(~T: Data, k: Nat, ax: Array & T, acc: List<&2, T>) -> List<&2, T>: match k: case 0n: (a, x) = ax x <> acc case 1n+(+p): (a, x) = ax shuffle.read(~T, p, Array.get(T, a, U32.from_nat(p)), x <> acc) Uses (7): 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=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