def bsearch.array.pick
import bend-osdev-algo@0.1.0.0/bsearch.bend as Bsearchimport Base
84# one halving of [lo, hi): the element at mid decides which half stays
85def bsearch.array.pick(below: Bool, a: Array<U32>, +lo: U32, +hi: U32, +mid: U32) -> BsearchState:
86 match below:
87 case True{}:
88 BsearchState{a, U32.inc(mid), hi}
89 case False{}:
90 BsearchState{a, lo, mid}