Array.Arrays.leaves: def of bend-osdev-array@0.1.0.1 Import: import bend-osdev-array@0.1.0.1/array.bend as Array Lines 35-42 of bend-osdev-array@0.1.0.1/array.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-array@0.1.0.1/array.bend&start_line=35&end_line=42 import Base # the slots of an array, in index order: the list model the laws compare # Array.get and Array.set with (a specification: it walks the whole array) def Arrays.leaves(-T: Data, a: Array) -> List<&2, T>: match a: case ALeaf{x}: Con{x, Nil{}} case ANode{xs, ys}: List.append(&2, T, Arrays.leaves(T, xs), Arrays.leaves(T, ys)) Uses (3): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append