def pop_go

bend-collections@1.0.0.0 · src/containers/binary_heap.bend:278

import bend-collections@1.0.0.0/src/containers/binary_heap.bend as BinaryHeap
import Base
import bend-collections@1.0.0.0/src/containers/types/binary_heap.bend as E

278def pop_go(~A: Data, ~cmp: A -> A -> Cmp, size: Nat, +n: U32, depth: Nat, cap: U32, arr: Array<Maybe<&2, A>>, empty: Bool) -> Heap<A> & Result<&2, &2, E.Error, A>:
279  match empty:
280    case True{}:
281      (BH{size, n, depth, cap, arr}, Fail{E.EmptyHeap{}})
282    case False{}:
283      pop_root(~A, ~cmp, size, n, depth, cap, Array.get(Maybe<&2, A>, arr, 0))

Uses (13)

Used by (1)