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 β) → Array.size ks = Array.size vs → Lean.PersistentHashMap.Node α β
Instances For
Equations
- Lean.PersistentHashMap.instInhabitedNode = { default := Lean.PersistentHashMap.Node.entries #[] }
@[inline, reducible]
Equations
Instances For
@[inline, reducible]
Equations
Instances For
@[inline, reducible]
Equations
Instances For
@[inline, reducible]
Equations
Instances For
Equations
- Lean.PersistentHashMap.mkEmptyEntriesArray = mkArray (USize.toNat Lean.PersistentHashMap.branching) 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 α β)
:
Equations
- Lean.PersistentHashMap.isEmpty m = (m.size == 0)
Instances For
instance
Lean.PersistentHashMap.instInhabitedPersistentHashMap
{α : Type u_1}
{β : Type u_2}
[BEq α]
[Hashable α]
:
Equations
- Lean.PersistentHashMap.instInhabitedPersistentHashMap = { default := { root := Lean.PersistentHashMap.Node.entries Lean.PersistentHashMap.mkEmptyEntriesArray, size := 0 } }
Equations
- Lean.PersistentHashMap.mkEmptyEntries = Lean.PersistentHashMap.Node.entries Lean.PersistentHashMap.mkEmptyEntriesArray
Instances For
@[inline, reducible]
Equations
- Lean.PersistentHashMap.mul2Shift i shift = USize.shiftLeft i shift
Instances For
@[inline, reducible]
Equations
- Lean.PersistentHashMap.div2Shift i shift = USize.shiftRight i shift
Instances For
@[inline, reducible]
Equations
- Lean.PersistentHashMap.mod2Shift i shift = USize.land i (USize.shiftLeft 1 shift - 1)
Instances For
- mk: ∀ {α : Type u_1} {β : Type u_2} (keys : Array α) (vals : Array β) (h : Array.size keys = Array.size vals), Lean.PersistentHashMap.IsCollisionNode (Lean.PersistentHashMap.Node.collision keys vals h)
Instances For
@[inline, reducible]
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
@[inline, reducible]
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 α β
partial def
Lean.PersistentHashMap.insertAux.traverse
{α : Type u_1}
{β : Type u_2}
[BEq α]
[Hashable α]
(depth : USize)
(keys : Array α)
(vals : Array β)
(heq : Array.size keys = Array.size vals)
(i : Nat)
(entries : Lean.PersistentHashMap.Node α β)
:
def
Lean.PersistentHashMap.insert
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → α → β → Lean.PersistentHashMap α β
Equations
- Lean.PersistentHashMap.insert x x x = match x, x, x with | { root := n, size := sz }, k, v => { root := Lean.PersistentHashMap.insertAux n (UInt64.toUSize (hash k)) 1 k v, size := sz + 1 }
Instances For
partial def
Lean.PersistentHashMap.findAtAux
{α : Type u_1}
{β : Type u_2}
[BEq α]
(keys : Array α)
(vals : Array β)
(heq : Array.size keys = Array.size vals)
(i : Nat)
(k : α)
:
Option β
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
- Lean.PersistentHashMap.find? x x = match x, x with | { root := n, size := size }, k => Lean.PersistentHashMap.findAux n (UInt64.toUSize (hash k)) k
Instances For
instance
Lean.PersistentHashMap.instGetElemPersistentHashMapOptionTrue
{α : Type u_1}
{β : Type u_2}
:
Equations
- Lean.PersistentHashMap.instGetElemPersistentHashMapOptionTrue = { getElem := fun m i x => Lean.PersistentHashMap.find? m i }
@[inline]
def
Lean.PersistentHashMap.findD
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → α → β → β
Equations
- Lean.PersistentHashMap.findD m a b₀ = Option.getD (Lean.PersistentHashMap.find? m a) b₀
Instances For
@[inline]
def
Lean.PersistentHashMap.find!
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → [inst : Inhabited β] → Lean.PersistentHashMap α β → α → β
Equations
- One or more equations did not get rendered due to their size.
Instances For
partial def
Lean.PersistentHashMap.findEntryAtAux
{α : Type u_1}
{β : Type u_2}
[BEq α]
(keys : Array α)
(vals : Array β)
(heq : Array.size keys = Array.size vals)
(i : Nat)
(k : α)
:
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
- Lean.PersistentHashMap.findEntry? x x = match x, x with | { root := n, size := size }, k => Lean.PersistentHashMap.findEntryAux n (UInt64.toUSize (hash k)) k
Instances For
partial def
Lean.PersistentHashMap.containsAtAux
{α : Type u_1}
{β : Type u_2}
[BEq α]
(keys : Array α)
(vals : Array β)
(heq : Array.size keys = Array.size vals)
(i : Nat)
(k : α)
:
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
- Lean.PersistentHashMap.contains x x = match x, x with | { root := n, size := size }, k => Lean.PersistentHashMap.containsAux n (UInt64.toUSize (hash k)) 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 σ
partial def
Lean.PersistentHashMap.foldlMAux.traverse
{m : Type w → Type w'}
[Monad m]
{σ : Type w}
{α : Type u_1}
{β : Type u_2}
(f : σ → α → β → m σ)
(keys : Array α)
(vals : Array β)
(heq : Array.size keys = Array.size vals)
(i : Nat)
(acc : σ)
:
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
- Lean.PersistentHashMap.foldlM map 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
- Lean.PersistentHashMap.forM map f = Lean.PersistentHashMap.foldlM map (fun x => 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
- Lean.PersistentHashMap.foldl map f init = Id.run (Lean.PersistentHashMap.foldlM map f init)
Instances For
instance
Lean.PersistentHashMap.instForInPersistentHashMapProd
{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
- Lean.PersistentHashMap.mapM pm 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
- Lean.PersistentHashMap.map pm f = Id.run (Lean.PersistentHashMap.mapM pm f)
Instances For
def
Lean.PersistentHashMap.toList
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → List (α × β)
Equations
- Lean.PersistentHashMap.toList m = Lean.PersistentHashMap.foldl m (fun ps k v => (k, v) :: ps) []
Instances For
def
Lean.PersistentHashMap.stats
{α : Type u_1}
{β : Type u_2}
:
{x : BEq α} → {x_1 : Hashable α} → Lean.PersistentHashMap α β → Lean.PersistentHashMap.Stats
Equations
- Lean.PersistentHashMap.stats m = 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.