Defs.view: def of lawful-arrays@0.1.0.0 Import: import lawful-arrays@0.1.0.0/defs.bend as Defs Lines 22-29 of lawful-arrays@0.1.0.0/defs.bend: https://jend.leeeet.dev/read.txt?path=lawful-arrays@0.1.0.0/defs.bend&start_line=22&end_line=29 import Base # The leaves of a, left to right (the same list as Base's Array.to_list, which # is a template and cannot appear in a law). Elements must be Data. def view(-T: Data, a: Array) -> List<&2, T>: match a: case ALeaf{x}: [x] case ANode{xs, ys}: List.append(&2, T, view(T, xs), view(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