def bsearch.sorted.pair

bend-osdev-algo@0.1.0.0 · bsearch.bend:18

import bend-osdev-algo@0.1.0.0/bsearch.bend as Bsearch
import Base

18# Sorted: each element is at most the next
19def bsearch.sorted.pair(xs: List<&2, U32>, x: U32) -> Bool:
20  match xs:
21    case Nil{}:
22      True{}
23    case Con{+y, t}:
24      Bool.and(U32.is_le(x, y), bsearch.sorted.pair(t, y))

Uses (5)

Used by (3)