Equations
- Lean.RBTree α cmp = Lean.RBMap α Unit cmp
Instances For
instance
Lean.instInhabitedRBTree
{α : Type u_1}
{p : α → α → Ordering}
:
Inhabited (Lean.RBTree α p)
@[inline]
Instances For
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)
:
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)
:
β
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
Instances For
@[inline]
def
Lean.RBTree.forIn
{α : Type u}
{cmp : α → α → Ordering}
{m : Type u_1 → Type u_2}
{σ : Type u_1}
[Monad m]
(t : Lean.RBTree α cmp)
(init : σ)
(f : α → σ → m (ForInStep σ))
:
m σ
Instances For
@[specialize #[]]
Equations
- t.toList = Lean.RBTree.revFold (fun (as : List α) (a : α) => a :: as) [] t
Instances For
@[specialize #[]]
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)
@[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 #[]]
Instances For
@[inline]
def
Lean.RBTree.find?
{α : Type u}
{cmp : α → α → Ordering}
(t : Lean.RBTree α cmp)
(a : α)
:
Option α
Instances For
@[inline]
Equations
- t.contains a = (t.find? a).isSome
Instances For
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]
Instances For
Equations
- t₁.subset t₂ = t₁.all fun (a : α) => (t₂.find? a).isSome
Instances For
Instances For
def
Lean.RBTree.union
{α : Type u}
{cmp : α → α → Ordering}
(t₁ 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₁ t₂ : Lean.RBTree α cmp)
:
Lean.RBTree α cmp
Equations
- t₁.diff t₂ = Lean.RBTree.fold Lean.RBTree.erase t₁ t₂
Instances For
def
Lean.RBTree.filter
{α : Type u}
{cmp : α → α → Ordering}
(f : α → Bool)
(m : Lean.RBTree α cmp)
:
Lean.RBTree α cmp
filter f m
returns the RBTree
consisting of all
x
in m
where f x
returns true
.