Frame.update_frame: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/storage/frame.bend as Frame Lines 26-53 of bendtorch-core@0.1.0.0/src/storage/frame.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/storage/frame.bend&start_line=26&end_line=53 import Base import bendtorch-core@0.1.0.0/src/storage/model.bend as Model import bendtorch-core@0.1.0.0/src/storage/array.bend as ArrayCore def update_frame(-T: Data, +d: Nat, array: Array, +i: Model.Path(d), +j: Model.Path(d), +value: T, valid: Model.Balanced(T, d, array)) -> {Model.observe(T, d, ArrayCore.write_path(T, d, array, i, value), j) == Model.select(T, Model.same(d, i, j), value, Model.observe(T, d, array, j)) : Maybe<&2, T>}: match d array: case 0n ALeaf{old}: {==} case 0n ANode{xs, ys}: match valid: case 1n+p ALeaf{old}: match valid: case 1n++p ANode{xs, ys}: Model.Step{ib, ir} = i match ib: case False{}: Model.Step{jb, jr} = j match jb: case False{}: (ex, ey) = valid update_frame(T, p, xs, ir, jr, value, ex) case True{}: {==} case True{}: Model.Step{jb, jr} = j match jb: case False{}: {==} case True{}: (ex, ey) = valid update_frame(T, p, ys, ir, jr, value, ey) 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=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/array.bend&name=write_path 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 https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/model.bend&name=observe https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/model.bend&name=same https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/model.bend&name=select