def bounds_valid

bend-collections@1.0.0.0 · src/containers/balanced_search_tree.bend:604

import bend-collections@1.0.0.0/src/containers/balanced_search_tree.bend as BalancedSearchTree
import Base

604def bounds_valid(~K: Data, ~V: Data, ~cmp: K -> K -> Cmp, lower: Bound<K>, upper: Bound<K>) -> Bool:
605  match lower upper:
606    case Unbounded{} _:
607      True{}
608    case _ Unbounded{}:
609      True{}
610    case Inclusive{lo} Inclusive{hi}:
611      ordering_ok(cmp(lo, hi), True{})
612    case Inclusive{lo} Exclusive{hi}:
613      ordering_ok(cmp(lo, hi), True{})
614    case Exclusive{lo} Inclusive{hi}:
615      ordering_ok(cmp(lo, hi), True{})
616    case Exclusive{lo} Exclusive{hi}:
617      ordering_ok(cmp(lo, hi), True{})

Uses (4)

Used by (1)