def slot_or

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

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

63# The slot value, with a default that a well-formed heap never needs (every
64# index a sift loop reads is inside [0, size), where the slot is Some).
65def slot_or(~A: Data, d: A, m: Maybe<&2, A>) -> A:
66  match m:
67    case None{}:
68      d
69    case Some{v}:
70      v

Uses (1)

Used by (1)