Equations
- Lean.RBTree α cmp = Lean.RBMap α Unit cmp
Instances For
instance
Lean.instInhabitedRBTree
{α : Type u_1}
{p : α → α → Ordering}
:
Inhabited (Lean.RBTree α p)
Equations
- Lean.instInhabitedRBTree = { default := Lean.RBMap.empty }
instance
Lean.instEmptyCollectionRBTree
(α : Type u)
(cmp : α → α → Ordering)
:
EmptyCollection (Lean.RBTree α cmp)
Equations
- Lean.instEmptyCollectionRBTree α cmp = { emptyCollection := Lean.mkRBTree α cmp }
@[inline]
def
Lean.RBTree.depth
{α : Type u}
{cmp : α → α → Ordering}
(f : Nat → Nat → Nat)
(t : Lean.RBTree α cmp)
:
Equations
- Lean.RBTree.depth f t = Lean.RBMap.depth f t
Instances For
@[inline]
def
Lean.RBTree.fold
{α : Type u}
{β : Type v}
{cmp : α → α → Ordering}
(f : β → α → β)
(init : β)
(t : Lean.RBTree α cmp)
:
β
Equations
- Lean.RBTree.fold f init t = Lean.RBMap.fold (fun (r : β) (a : α) (x : Unit) => f r a) init t
Instances For
@[inline]
def
Lean.RBTree.revFold
{α : Type u}
{β : Type v}
{cmp : α → α → Ordering}
(f : β → α → β)
(init : β)
(t : Lean.RBTree α cmp)
:
β
Equations
- Lean.RBTree.revFold f init t = Lean.RBMap.revFold (fun (r : β) (a : α) (x : Unit) => f r a) init t
Instances For
@[inline]
def
Lean.RBTree.foldM
{α : Type u}
{β : Type v}
{cmp : α → α → Ordering}
{m : Type v → Type w}
[Monad m]
(f : β → α → m β)
(init : β)
(t : Lean.RBTree α cmp)
:
m β
Equations
- Lean.RBTree.foldM f init t = Lean.RBMap.foldM (fun (r : β) (a : α) (x : Unit) => f r a) init t
Instances For
@[inline]
def
Lean.RBTree.forM
{α : Type u}
{cmp : α → α → Ordering}
{m : Type v → Type w}
[Monad m]
(f : α → m PUnit)
(t : Lean.RBTree α cmp)
:
m PUnit
Equations
- Lean.RBTree.forM f t = Lean.RBTree.foldM (fun (x : PUnit) (a : α) => f a) PUnit.unit t
Instances For
@[specialize #[]]
Equations
- t.toList = Lean.RBTree.revFold (fun (as : List α) (a : α) => a :: as) [] t
Instances For
@[specialize #[]]
Equations
- t.toArray = Lean.RBTree.fold (fun (as : Array α) (a : α) => as.push a) #[] t
Instances For
@[inline]
Equations
- t.min = match Lean.RBMap.min t with | some (a, snd) => some a | none => none
Instances For
@[inline]
Equations
- t.max = match Lean.RBMap.max t with | some (a, snd) => some a | none => none
Instances For
instance
Lean.RBTree.instRepr
{α : Type u}
{cmp : α → α → Ordering}
[Repr α]
:
Repr (Lean.RBTree α cmp)
Equations
- Lean.RBTree.instRepr = { reprPrec := fun (t : Lean.RBTree α cmp) (prec : Nat) => Repr.addAppParen (Std.Format.text "Lean.rbtreeOf " ++ repr t.toList) prec }
@[inline]
def
Lean.RBTree.insert
{α : Type u}
{cmp : α → α → Ordering}
(t : Lean.RBTree α cmp)
(a : α)
:
Lean.RBTree α cmp
Equations
- t.insert a = Lean.RBMap.insert t a ()
Instances For
@[inline]
def
Lean.RBTree.erase
{α : Type u}
{cmp : α → α → Ordering}
(t : Lean.RBTree α cmp)
(a : α)
:
Lean.RBTree α cmp
Equations
- t.erase a = Lean.RBMap.erase t a
Instances For
@[specialize #[]]
Equations
- Lean.RBTree.ofList [] = Lean.mkRBTree α cmp
- Lean.RBTree.ofList (x_1 :: xs) = (Lean.RBTree.ofList xs).insert x_1
Instances For
@[inline]
def
Lean.RBTree.find?
{α : Type u}
{cmp : α → α → Ordering}
(t : Lean.RBTree α cmp)
(a : α)
:
Option α
Equations
- t.find? a = match Lean.RBMap.findCore? t a with | some ⟨a, snd⟩ => some a | none => none
Instances For
@[inline]
Equations
- t.contains a = (t.find? a).isSome
Instances For
Equations
- Lean.RBTree.fromList l cmp = List.foldl Lean.RBTree.insert (Lean.mkRBTree α cmp) l
Instances For
Equations
- Lean.RBTree.fromArray l cmp = Array.foldl Lean.RBTree.insert (Lean.mkRBTree α cmp) l
Instances For
@[inline]
Equations
- t.all p = Lean.RBMap.all t fun (a : α) (x : Unit) => p a
Instances For
@[inline]
Equations
- t.any p = Lean.RBMap.any t fun (a : α) (x : Unit) => p a
Instances For
def
Lean.RBTree.subset
{α : Type u}
{cmp : α → α → Ordering}
(t₁ : Lean.RBTree α cmp)
(t₂ : Lean.RBTree α cmp)
:
Equations
- t₁.subset t₂ = t₁.all fun (a : α) => (t₂.find? a).isSome
Instances For
def
Lean.RBTree.seteq
{α : Type u}
{cmp : α → α → Ordering}
(t₁ : Lean.RBTree α cmp)
(t₂ : Lean.RBTree α cmp)
:
Instances For
def
Lean.RBTree.union
{α : Type u}
{cmp : α → α → Ordering}
(t₁ : Lean.RBTree α cmp)
(t₂ : Lean.RBTree α cmp)
:
Lean.RBTree α cmp
Equations
- t₁.union t₂ = if t₁.isEmpty = true then t₂ else Lean.RBTree.fold Lean.RBTree.insert t₁ t₂
Instances For
def
Lean.RBTree.diff
{α : Type u}
{cmp : α → α → Ordering}
(t₁ : Lean.RBTree α cmp)
(t₂ : Lean.RBTree α cmp)
:
Lean.RBTree α cmp
Equations
- t₁.diff t₂ = Lean.RBTree.fold Lean.RBTree.erase t₁ t₂
Instances For
Equations
- Lean.rbtreeOf l cmp = Lean.RBTree.fromList l cmp