Equations
- Lean.RBTree α cmp = Lean.RBMap α Unit cmp
Instances For
@[instance_reducible]
Equations
- Lean.instInhabitedRBTree = { default := Lean.RBMap.empty }
@[instance_reducible]
instance Lean.instEmptyCollectionRBTree (α : Type u) (cmp : α → α → Ordering) :
EmptyCollection (RBTree α cmp)
Equations
- Lean.instEmptyCollectionRBTree α cmp = { emptyCollection := Lean.mkRBTree α cmp }
@[inline]
Equations
Instances For
@[inline]
def Lean.RBTree.depth {α : Type u} {cmp : α → α → Ordering} (f : Nat → Nat → Nat) (t : 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 : 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 : 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 : 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 : RBTree α cmp) :
m PUnit
Equations
- Lean.RBTree.forM f t = Lean.RBTree.foldM (fun (x : PUnit) (a : α) => f a) PUnit.unit t
Instances For
@[instance_reducible]
instance Lean.RBTree.instForInOfMonad {α : Type u} {cmp : α → α → Ordering} {m : Type u_1 → Type u_2} [Monad m] :
Equations
- Lean.RBTree.instForInOfMonad = { forIn := fun {β : Type ?u.2} => Lean.RBTree.forIn }
@[inline]
Equations
Instances For
@[instance_reducible]
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.erase {α : Type u} {cmp : α → α → Ordering} (t : RBTree α cmp) (a : α) :
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
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
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 : RBTree α cmp) :
RBTree α cmp
filter f m returns the RBTree consisting of all
x in m where f x returns true.
Equations
- Lean.RBTree.filter f m = Lean.RBMap.filter (fun (a : α) (x : Unit) => f a) m
Instances For
Equations
- Lean.rbtreeOf l cmp = Lean.RBTree.fromList l cmp