inductive
Lean.PersistentHashMap.Entry
(α : Type u)
(β : Type v)
(σ : Type w)
:
Type (max (max u v) w)
- entry: {α : Type u} → {β : Type v} → {σ : Type w} → α → β → Lean.PersistentHashMap.Entry α β σ
- ref: {α : Type u} → {β : Type v} → {σ : Type w} → σ → Lean.PersistentHashMap.Entry α β σ
- null: {α : Type u} → {β : Type v} → {σ : Type w} → Lean.PersistentHashMap.Entry α β σ
Instances For
Equations
- Lean.PersistentHashMap.instInhabitedEntry = { default := Lean.PersistentHashMap.Entry.null }
- entries: {α : Type u} → {β : Type v} → Array (Lean.PersistentHashMap.Entry α β (Lean.PersistentHashMap.Node α β)) → Lean.PersistentHashMap.Node α β
- collision: {α : Type u} → {β : Type v} → (ks : Array α) → (vs : Array β) → ks.size = vs.size → Lean.PersistentHashMap.Node α β
Instances For
Equations
- Lean.PersistentHashMap.instInhabitedNode = { default := Lean.PersistentHashMap.Node.entries #[] }
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Equations
Instances For
Equations
- Lean.PersistentHashMap.mkEmptyEntriesArray = mkArray Lean.PersistentHashMap.branching.toNat Lean.PersistentHashMap.Entry.null
Instances For
- root : Lean.PersistentHashMap.Node α β
- size : Nat
Instances For
Equations
- Lean.PersistentHashMap.empty = { root := Lean.PersistentHashMap.Node.entries Lean.PersistentHashMap.mkEmptyEntriesArray, size := 0 }
Instances For
def
Lean.PersistentHashMap.isEmpty
{α : Type u_1}
{β : Type u_2}
[BEq α]
[Hashable α]
(m : Lean.PersistentHashMap α β)
:
Instances For
Equations
- Lean.PersistentHashMap.instInhabited = { default := { root := Lean.PersistentHashMap.Node.entries Lean.PersistentHashMap.mkEmptyEntriesArray, size := 0 } }
Equations
- Lean.PersistentHashMap.mkEmptyEntries = Lean.PersistentHashMap.Node.entries Lean.PersistentHashMap.mkEmptyEntriesArray
Instances For
@[reducible, inline]
Equations
- Lean.PersistentHashMap.mul2Shift i shift = i.shiftLeft shift
Instances For
@[reducible, inline]
Equations
- Lean.PersistentHashMap.div2Shift i shift = i.shiftRight shift
Instances For
@[reducible, inline]
Equations
- Lean.PersistentHashMap.mod2Shift i shift = i.land (USize.shiftLeft 1 shift - 1)
Instances For
- mk: ∀ {α : Type u_1} {β : Type u_2} (keys : Array α) (vals : Array β) (h : keys.size = vals.size), Lean.PersistentHashMap.IsCollisionNode (Lean.PersistentHashMap.Node.collision keys vals h)
Instances For
@[reducible, inline]
Equations
Instances For
- mk: ∀ {α : Type u_1} {β : Type u_2} (entries : Array (Lean.PersistentHashMap.Entry α β (Lean.PersistentHashMap.Node α β))), Lean.PersistentHashMap.IsEntriesNode (Lean.PersistentHashMap.Node.entries entries)
Instances For
@[reducible, inline]
Equations
Instances For
partial def
Lean.PersistentHashMap.insertAtCollisionNodeAux
{α : Type u_1}
{β : Type u_2}
[BEq α]
:
Lean.PersistentHashMap.CollisionNode α β → Nat → α → β → Lean.PersistentHashMap.CollisionNode α β
def
Lean.PersistentHashMap.insertAtCollisionNode
{α : Type u_1}
{β : Type u_2}
[BEq α]
:
Lean.PersistentHashMap.CollisionNode α β → α → β → Lean.PersistentHashMap.CollisionNode α β
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.PersistentHashMap.mkCollisionNode
{α : Type u_1}
{β : Type u_2}
(k₁ : α)
(v₁ : β)
(k₂ : α)
(v₂ : β)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
partial def
Lean.PersistentHashMap.insertAux
{α : Type u_1}
{β : Type u_2}
[BEq α]
[Hashable α]
:
Lean.PersistentHashMap.Node α β → USize → USize → α → β → Lean.PersistentHashMap.Node α β
def
Lean.PersistentHashMap.insert
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → α → β → Lean.PersistentHashMap α β
Equations
- x✝¹.insert x✝ x = match x✝¹, x✝, x with | { root := n, size := sz }, k, v => { root := Lean.PersistentHashMap.insertAux n (hash k).toUSize 1 k v, size := sz + 1 }
Instances For
partial def
Lean.PersistentHashMap.findAux
{α : Type u_1}
{β : Type u_2}
[BEq α]
:
Lean.PersistentHashMap.Node α β → USize → α → Option β
def
Lean.PersistentHashMap.find?
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → α → Option β
Equations
- x✝.find? x = match x✝, x with | { root := n, size := size }, k => Lean.PersistentHashMap.findAux n (hash k).toUSize k
Instances For
instance
Lean.PersistentHashMap.instGetElemOptionTrue
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} →
{x_1 : Hashable α} →
GetElem (Lean.PersistentHashMap α β) α (Option β) fun (x : Lean.PersistentHashMap α β) (x : α) => True
Equations
- One or more equations did not get rendered due to their size.
instance
Lean.PersistentHashMap.instLawfulGetElemOptionTrue
{α : Type u_1}
{β : Type u_2}
:
∀ {x : BEq α} {x_1 : Hashable α},
LawfulGetElem (Lean.PersistentHashMap α β) α (Option β) fun (x : Lean.PersistentHashMap α β) (x : α) => True
Equations
- ⋯ = ⋯
@[inline]
def
Lean.PersistentHashMap.findD
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → α → β → β
Equations
- m.findD a b₀ = (m.find? a).getD b₀
Instances For
@[inline]
def
Lean.PersistentHashMap.find!
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → [inst : Inhabited β] → Lean.PersistentHashMap α β → α → β
Equations
- m.find! a = match m.find? a with | some b => b | none => panicWithPosWithDecl "Lean.Data.PersistentHashMap" "Lean.PersistentHashMap.find!" 166 14 "key is not in the map"
Instances For
partial def
Lean.PersistentHashMap.findEntryAux
{α : Type u_1}
{β : Type u_2}
[BEq α]
:
Lean.PersistentHashMap.Node α β → USize → α → Option (α × β)
def
Lean.PersistentHashMap.findEntry?
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → α → Option (α × β)
Equations
- x✝.findEntry? x = match x✝, x with | { root := n, size := size }, k => Lean.PersistentHashMap.findEntryAux n (hash k).toUSize k
Instances For
partial def
Lean.PersistentHashMap.containsAux
{α : Type u_1}
{β : Type u_2}
[BEq α]
:
Lean.PersistentHashMap.Node α β → USize → α → Bool
def
Lean.PersistentHashMap.contains
{α : Type u_1}
{β : Type u_2}
[BEq α]
[Hashable α]
:
Lean.PersistentHashMap α β → α → Bool
Equations
- x✝.contains x = match x✝, x with | { root := n, size := size }, k => Lean.PersistentHashMap.containsAux n (hash k).toUSize k
Instances For
partial def
Lean.PersistentHashMap.isUnaryEntries
{α : Type u_1}
{β : Type u_2}
(a : Array (Lean.PersistentHashMap.Entry α β (Lean.PersistentHashMap.Node α β)))
(i : Nat)
(acc : Option (α × β))
:
def
Lean.PersistentHashMap.isUnaryNode
{α : Type u_1}
{β : Type u_2}
:
Lean.PersistentHashMap.Node α β → Option (α × β)
Equations
- One or more equations did not get rendered due to their size.
Instances For
partial def
Lean.PersistentHashMap.eraseAux
{α : Type u_1}
{β : Type u_2}
[BEq α]
:
Lean.PersistentHashMap.Node α β → USize → α → Lean.PersistentHashMap.Node α β × Bool
def
Lean.PersistentHashMap.erase
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → α → Lean.PersistentHashMap α β
Equations
- One or more equations did not get rendered due to their size.
Instances For
partial def
Lean.PersistentHashMap.foldlMAux
{m : Type w → Type w'}
[Monad m]
{σ : Type w}
{α : Type u_1}
{β : Type u_2}
(f : σ → α → β → m σ)
:
Lean.PersistentHashMap.Node α β → σ → m σ
def
Lean.PersistentHashMap.foldlM
{m : Type w → Type w'}
[Monad m]
{σ : Type w}
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → (σ → α → β → m σ) → σ → m σ
Equations
- map.foldlM f init = Lean.PersistentHashMap.foldlMAux f map.root init
Instances For
def
Lean.PersistentHashMap.forM
{m : Type w → Type w'}
[Monad m]
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → (α → β → m PUnit) → m PUnit
Equations
- map.forM f = map.foldlM (fun (x : PUnit) => f) PUnit.unit
Instances For
def
Lean.PersistentHashMap.foldl
{σ : Type w}
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → (σ → α → β → σ) → σ → σ
Equations
- map.foldl f init = (map.foldlM f init).run
Instances For
instance
Lean.PersistentHashMap.instForInProd
{m : Type w → Type w'}
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → ForIn m (Lean.PersistentHashMap α β) (α × β)
partial def
Lean.PersistentHashMap.mapMAux
{α : Type u}
{β : Type v}
{σ : Type u}
{m : Type u → Type w}
[Monad m]
(f : β → m σ)
(n : Lean.PersistentHashMap.Node α β)
:
m (Lean.PersistentHashMap.Node α σ)
def
Lean.PersistentHashMap.mapM
{α : Type u}
{β : Type v}
{σ : Type u}
{m : Type u → Type w}
[Monad m]
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → (β → m σ) → m (Lean.PersistentHashMap α σ)
Equations
- pm.mapM f = do let root ← Lean.PersistentHashMap.mapMAux f pm.root pure { root := root, size := pm.size }
Instances For
def
Lean.PersistentHashMap.map
{α : Type u}
{β : Type v}
{σ : Type u}
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → (β → σ) → Lean.PersistentHashMap α σ
Equations
- pm.map f = (pm.mapM f).run
Instances For
def
Lean.PersistentHashMap.stats
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → Lean.PersistentHashMap.Stats
Equations
- m.stats = Lean.PersistentHashMap.collectStats m.root { numNodes := 0, numNull := 0, numCollisions := 0, maxDepth := 0 } 1
Instances For
Equations
- One or more equations did not get rendered due to their size.