Documentation

Lake.Util.DRBMap

This module includes a dependently typed adaption of the Lean.RBMap defined in Lean.Data.RBMap module of the Lean core. Most of the code is copied directly from there with only minor edits.

@[specialize #[]]
def Lake.RBNode.dFind {α : Type u} {β : αType v} (cmp : ααOrdering) [h : EqOfCmpWrt α β cmp] :
Lean.RBNode α β(k : α) → Option (β k)
Equations
def Lake.DRBMap (α : Type u) (β : αType v) (cmp : ααOrdering) :
Type (max u v)

A Dependently typed RBMap.

Equations
Instances For
instance Lake.instCoeDRBMapRBMap {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} :
Coe (DRBMap α (fun (x : α) => β) cmp) (Lean.RBMap α β cmp)
Equations
@[inline]
def Lake.mkDRBMap (α : Type u) (β : αType v) (cmp : ααOrdering) :
DRBMap α β cmp
Equations
@[inline]
def Lake.DRBMap.empty {α : Type u} {β : αType v} {cmp : ααOrdering} :
DRBMap α β cmp
Equations
instance Lake.instEmptyCollectionDRBMap (α : Type u) (β : αType v) (cmp : ααOrdering) :
Equations
def Lake.DRBMap.depth {α : Type u} {β : αType v} {cmp : ααOrdering} (f : NatNatNat) (t : DRBMap α β cmp) :
Equations
@[inline]
def Lake.DRBMap.fold {α : Type u} {β : αType v} {σ : Type w} {cmp : ααOrdering} (f : σ(k : α) → β kσ) (init : σ) :
DRBMap α β cmpσ
Equations
@[inline]
def Lake.DRBMap.revFold {α : Type u} {β : αType v} {σ : Type w} {cmp : ααOrdering} (f : σ(k : α) → β kσ) (init : σ) :
DRBMap α β cmpσ
Equations
@[inline]
def Lake.DRBMap.foldM {α : Type u} {β : αType v} {σ : Type w} {cmp : ααOrdering} {m : Type w → Type u_1} [Monad m] (f : σ(k : α) → β km σ) (init : σ) :
DRBMap α β cmpm σ
Equations
@[inline]
def Lake.DRBMap.forM {α : Type u} {β : αType v} {cmp : ααOrdering} {m : Type u_1 → Type u_2} [Monad m] (f : (k : α) → β km PUnit) (t : DRBMap α β cmp) :
Equations
@[inline]
def Lake.DRBMap.forIn {α : Type u} {β : αType v} {σ : Type w} {cmp : ααOrdering} {m : Type w → Type u_1} [Monad m] (t : DRBMap α β cmp) (init : σ) (f : (k : α) × β kσm (ForInStep σ)) :
m σ
Equations
  • t.forIn init f = t.val.forIn init fun (a : α) (b : β a) (acc : σ) => f a, b acc
instance Lake.DRBMap.instForInSigma {α : Type u} {β : αType v} {cmp : ααOrdering} {m : Type u_1 → Type u_2} :
ForIn m (DRBMap α β cmp) ((k : α) × β k)
Equations
@[inline]
def Lake.DRBMap.isEmpty {α : Type u} {β : αType v} {cmp : ααOrdering} :
DRBMap α β cmpBool
Equations
@[specialize #[]]
def Lake.DRBMap.toList {α : Type u} {β : αType v} {cmp : ααOrdering} :
DRBMap α β cmpList ((k : α) × β k)
Equations
@[inline]
def Lake.DRBMap.min {α : Type u} {β : αType v} {cmp : ααOrdering} :
DRBMap α β cmpOption ((k : α) × β k)
Equations
@[inline]
def Lake.DRBMap.max {α : Type u} {β : αType v} {cmp : ααOrdering} :
DRBMap α β cmpOption ((k : α) × β k)
Equations
instance Lake.DRBMap.instReprOfSigma {α : Type u} {β : αType v} {cmp : ααOrdering} [Repr ((k : α) × β k)] :
Repr (DRBMap α β cmp)
Equations
@[inline]
def Lake.DRBMap.insert {α : Type u} {β : αType v} {cmp : ααOrdering} :
DRBMap α β cmp(k : α) → β kDRBMap α β cmp
Equations
@[inline]
def Lake.DRBMap.erase {α : Type u} {β : αType v} {cmp : ααOrdering} :
DRBMap α β cmpαDRBMap α β cmp
Equations
@[specialize #[]]
def Lake.DRBMap.ofList {α : Type u} {β : αType v} {cmp : ααOrdering} :
List ((k : α) × β k)DRBMap α β cmp
Equations
@[inline]
def Lake.DRBMap.findCore? {α : Type u} {β : αType v} {cmp : ααOrdering} :
DRBMap α β cmpαOption ((k : α) × β k)
Equations
@[inline]
def Lake.DRBMap.find? {α : Type u} {β : αType v} {cmp : ααOrdering} [EqOfCmpWrt α β cmp] :
DRBMap α β cmp(k : α) → Option (β k)
Equations
@[inline]
def Lake.DRBMap.findD {α : Type u} {β : αType v} {cmp : ααOrdering} [EqOfCmpWrt α β cmp] (t : DRBMap α β cmp) (k : α) (v₀ : β k) :
β k
Equations
@[inline]
def Lake.DRBMap.lowerBound {α : Type u} {β : αType v} {cmp : ααOrdering} :
DRBMap α β cmpαOption ((k : α) × β k)

(lowerBound k) retrieves the kv pair of the largest key smaller than or equal to k, if it exists.

Equations
@[inline]
def Lake.DRBMap.contains {α : Type u} {β : αType v} {cmp : ααOrdering} [EqOfCmpWrt α β cmp] (t : DRBMap α β cmp) (k : α) :
Equations
@[inline]
def Lake.DRBMap.fromList {α : Type u} {β : αType v} (l : List ((k : α) × β k)) (cmp : ααOrdering) :
DRBMap α β cmp
Equations
@[inline]
def Lake.DRBMap.all {α : Type u} {β : αType v} {cmp : ααOrdering} :
DRBMap α β cmp((k : α) → β kBool)Bool
Equations
@[inline]
def Lake.DRBMap.any {α : Type u} {β : αType v} {cmp : ααOrdering} :
DRBMap α β cmp((k : α) → β kBool)Bool
Equations
def Lake.DRBMap.size {α : Type u} {β : αType v} {cmp : ααOrdering} (m : DRBMap α β cmp) :
Equations
def Lake.DRBMap.maxDepth {α : Type u} {β : αType v} {cmp : ααOrdering} (t : DRBMap α β cmp) :
Equations
@[inline]
def Lake.DRBMap.min! {α : Type u} {β : αType v} {cmp : ααOrdering} [Inhabited ((k : α) × β k)] (t : DRBMap α β cmp) :
(k : α) × β k
Equations
@[inline]
def Lake.DRBMap.max! {α : Type u} {β : αType v} {cmp : ααOrdering} [Inhabited ((k : α) × β k)] (t : DRBMap α β cmp) :
(k : α) × β k
Equations
@[inline]
def Lake.DRBMap.find! {α : Type u} {β : αType v} {cmp : ααOrdering} [EqOfCmpWrt α β cmp] (t : DRBMap α β cmp) (k : α) [Inhabited (β k)] :
β k
Equations
def Lake.drbmapOf {α : Type u} {β : αType v} (l : List ((k : α) × β k)) (cmp : ααOrdering) :
DRBMap α β cmp
Equations