- stage₁ : Bool
- map₁ : Std.HashMap α β
- map₂ : Std.PHashMap α β
Equations
- Lean.SMap.instInhabitedSMap = { default := { stage₁ := true, map₁ := ∅, map₂ := { root := Std.PersistentHashMap.Node.entries Std.PersistentHashMap.mkEmptyEntriesArray, size := 0 } } }
Equations
- Lean.SMap.empty = { stage₁ := true, map₁ := ∅, map₂ := { root := Std.PersistentHashMap.Node.entries Std.PersistentHashMap.mkEmptyEntriesArray, size := 0 } }
@[inline]
def
Lean.SMap.fromHashMap
{α : Type u}
{β : Type v}
[inst : BEq α]
[inst : Hashable α]
(m : Std.HashMap α β)
(stage₁ : optParam Bool true)
:
Lean.SMap α β
Equations
- Lean.SMap.fromHashMap m stage₁ = { stage₁ := stage₁, map₁ := m, map₂ := { root := Std.PersistentHashMap.Node.entries Std.PersistentHashMap.mkEmptyEntriesArray, size := 0 } }
@[inline]
def
Lean.SMap.findD
{α : Type u}
{β : Type v}
[inst : BEq α]
[inst : Hashable α]
(m : Lean.SMap α β)
(a : α)
(b₀ : β)
:
β
Equations
- Lean.SMap.findD m a b₀ = Option.getD (Lean.SMap.find? m a) b₀
@[inline]
def
Lean.SMap.find!
{α : Type u}
{β : Type v}
[inst : BEq α]
[inst : Hashable α]
[inst : Inhabited β]
(m : Lean.SMap α β)
(a : α)
:
β
Equations
- Lean.SMap.find! m a = match Lean.SMap.find? m a with | some b => b | none => panicWithPosWithDecl "Lean.Data.SMap" "Lean.SMap.find!" 62 14 "key is not in the map"
def
Lean.SMap.forM
{α : Type u}
{β : Type v}
[inst : BEq α]
[inst : Hashable α]
{m : Type u_1 → Type u_1}
[inst : Monad m]
(s : Lean.SMap α β)
(f : α → β → m PUnit)
:
m PUnit
Equations
- Lean.SMap.forM s f = do Std.HashMap.forM f s.map₁ Std.PersistentHashMap.forM s.map₂ f
@[inline]
def
Lean.SMap.foldStage2
{α : Type u}
{β : Type v}
[inst : BEq α]
[inst : Hashable α]
{σ : Type w}
(f : σ → α → β → σ)
(s : σ)
(m : Lean.SMap α β)
:
σ
Equations
- Lean.SMap.foldStage2 f s m = Std.PersistentHashMap.foldl m.map₂ f s
def
Lean.SMap.fold
{α : Type u}
{β : Type v}
[inst : BEq α]
[inst : Hashable α]
{σ : Type w}
(f : σ → α → β → σ)
(init : σ)
(m : Lean.SMap α β)
:
σ
Equations
- Lean.SMap.fold f init m = Std.PersistentHashMap.foldl m.map₂ f (Std.HashMap.fold f init m.map₁)
def
Lean.SMap.size
{α : Type u}
{β : Type v}
[inst : BEq α]
[inst : Hashable α]
(m : Lean.SMap α β)
:
Equations
- Lean.SMap.size m = Std.HashMap.size m.map₁ + m.map₂.size
def
Lean.SMap.stageSizes
{α : Type u}
{β : Type v}
[inst : BEq α]
[inst : Hashable α]
(m : Lean.SMap α β)
:
Equations
- Lean.SMap.stageSizes m = (Std.HashMap.size m.map₁, m.map₂.size)
def
Lean.SMap.numBuckets
{α : Type u}
{β : Type v}
[inst : BEq α]
[inst : Hashable α]
(m : Lean.SMap α β)
:
Equations
- Lean.SMap.numBuckets m = Std.HashMap.numBuckets m.map₁
def
Lean.SMap.toList
{α : Type u}
{β : Type v}
[inst : BEq α]
[inst : Hashable α]
(m : Lean.SMap α β)
:
Equations
- Lean.SMap.toList m = Lean.SMap.fold (fun es a b => (a, b) :: es) [] m
Equations
- Lean.instReprSMap = { reprPrec := fun v prec => Repr.addAppParen (reprArg (Lean.SMap.toList v) ++ Std.Format.text ".toSMap") prec }