fn go_search(n: usize, f: impl Fn(usize) -> bool) -> usizeExpand description
Go’s sort.Search: the smallest index in [0, n) where f holds, or n, found by the same
bisection, so a predicate that is not monotonic (NaN counts) picks the same index.