Array.read_path: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/storage/array.bend as Array Lines 42-59 of bendtorch-core@0.1.0.0/src/storage/array.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/storage/array.bend&start_line=42&end_line=59 import Base import bendtorch-core@0.1.0.0/src/storage/model.bend as Model def read_path(-T: Data, +d: Nat, array: Array, path: Model.Path(d), -valid: Model.Balanced(T, d, array)) -> Read: match d array: case 0n ALeaf{+value}: Read{ALeaf{value}, Some{value}, valid, {==}, {==}} case 0n ANode{xs, ys}: Read{ANode{xs, ys}, None{}, valid, {==}, {==}} case 1n+p ALeaf{value}: Read{ALeaf{value}, None{}, valid, {==}, {==}} case 1n++p ANode{xs, ys}: Model.Step{bit, rest} = path match bit: case False{}: low(T, p, xs, rest, ys, read_path(T, p, xs, rest, left(T, p, xs, ys, valid)), right(T, p, xs, ys, valid)) case True{}: high(T, p, ys, rest, xs, read_path(T, p, ys, rest, right(T, p, xs, ys, valid)), left(T, p, xs, ys, valid)) Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/array.bend&name=Read https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/array.bend&name=high https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/array.bend&name=left https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/array.bend&name=low https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/array.bend&name=right https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/model.bend&name=Balanced https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/model.bend&name=Path https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/model.bend&name=Step