def bsearch.lower_bound
import bend-osdev-algo@0.1.0.0/bsearch.bend as Bsearchimport Base
42# the number of leading elements below key: on a sorted list, the index of
43# the first element not below key (the length if there is none)
44def bsearch.lower_bound(xs: List<&2, U32>, +key: U32) -> Nat:
45 match xs:
46 case Nil{}:
47 0n
48 case Con{x, t}:
49 bsearch.below.step(U32.is_lt(x, key), bsearch.lower_bound(t, key))