BinaryHeap.pop_move: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/containers/binary_heap.bend as BinaryHeap Lines 248-255 of bend-collections@1.0.0.0/src/containers/binary_heap.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/containers/binary_heap.bend&start_line=248&end_line=255 import Base import bend-collections@1.0.0.0/src/containers/types/binary_heap.bend as E # The last element has been taken out of slot m = n - 1; put it at the root # and sift it down over the remaining m elements. def pop_move(~A: Data, ~cmp: A -> A -> Cmp, size: Nat, +m: U32, +depth: Nat, cap: U32, root: A, last: A, arr: Array>, empty: Bool) -> Heap & Result<&2, &2, E.Error, A>: match empty: case True{}: (BH{size, m, depth, cap, arr}, Done{root}) case False{}: (BH{size, m, depth, cap, sift_down(~A, ~cmp, depth, m, 0, last, arr)}, Done{root}) 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=Cmp 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=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/binary_heap.bend&name=Heap https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/binary_heap.bend&name=sift_down https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/types/binary_heap.bend&name=Error