@[inline]
def
Array.binSearch
{α : Type}
(as : Array α)
(k : α)
(lt : α → α → Bool)
(lo : optParam Nat 0)
(hi : optParam Nat (Array.size as - 1))
:
Option α
Equations
- Array.binSearch as k lt lo hi = if lo < Array.size as then let hi := if hi < Array.size as then hi else Array.size as - 1; Array.binSearchAux lt id as k lo hi else none
Instances For
@[inline]
Equations
- Array.binInsert lt as k = Id.run (Array.binInsertM lt (fun x => k) (fun x => k) as k)