Equations
- Lean.HashSetBucket α = { b : Array (List α) // b.size.isPowerOfTwo }
Instances For
def
Lean.HashSetBucket.update
{α : Type u}
(data : Lean.HashSetBucket α)
(i : USize)
(d : List α)
(h : i.toNat < data.val.size)
:
Equations
- data.update i d h = ⟨data.val.uset i d h, ⋯⟩
Instances For
@[simp]
theorem
Lean.HashSetBucket.size_update
{α : Type u}
(data : Lean.HashSetBucket α)
(i : USize)
(d : List α)
(h : i.toNat < data.val.size)
:
(data.update i d h).val.size = data.val.size
@[deprecated Std.HashSet.Raw.empty]
Instances For
@[inline]
def
Lean.HashSetImp.reinsertAux
{α : Type u}
(hashFn : α → UInt64)
(data : Lean.HashSetBucket α)
(a : α)
:
Equations
- Lean.HashSetImp.reinsertAux hashFn data a = match Lean.HashSetImp.mkIdx✝ (hashFn a) ⋯ with | ⟨i, h⟩ => data.update i (a :: data.val[i]) h
Instances For
@[inline]
def
Lean.HashSetImp.foldBucketsM
{α : Type u}
{δ : Type w}
{m : Type w → Type w}
[Monad m]
(data : Lean.HashSetBucket α)
(d : δ)
(f : δ → α → m δ)
:
m δ
Instances For
@[inline]
def
Lean.HashSetImp.foldBuckets
{α : Type u}
{δ : Type w}
(data : Lean.HashSetBucket α)
(d : δ)
(f : δ → α → δ)
:
δ
Equations
- Lean.HashSetImp.foldBuckets data d f = (Lean.HashSetImp.foldBucketsM data d f).run
Instances For
@[inline]
def
Lean.HashSetImp.foldM
{α : Type u}
{δ : Type w}
{m : Type w → Type w}
[Monad m]
(f : δ → α → m δ)
(d : δ)
(h : Lean.HashSetImp α)
:
m δ
Equations
- Lean.HashSetImp.foldM f d h = Lean.HashSetImp.foldBucketsM h.buckets d f
Instances For
@[inline]
def
Lean.HashSetImp.fold
{α : Type u}
{δ : Type w}
(f : δ → α → δ)
(d : δ)
(m : Lean.HashSetImp α)
:
δ
Equations
- Lean.HashSetImp.fold f d m = Lean.HashSetImp.foldBuckets m.buckets d f
Instances For
@[inline]
def
Lean.HashSetImp.forBucketsM
{α : Type u}
{m : Type w → Type w}
[Monad m]
(data : Lean.HashSetBucket α)
(f : α → m PUnit)
:
m PUnit
Equations
- Lean.HashSetImp.forBucketsM data f = Array.forM (fun (as : List α) => as.forM f) data.val
Instances For
@[inline]
def
Lean.HashSetImp.forM
{α : Type u}
{m : Type w → Type w}
[Monad m]
(f : α → m PUnit)
(h : Lean.HashSetImp α)
:
m PUnit
Instances For
def
Lean.HashSetImp.find?
{α : Type u}
[BEq α]
[Hashable α]
(m : Lean.HashSetImp α)
(a : α)
:
Option α
Instances For
Instances For
@[irreducible]
def
Lean.HashSetImp.moveEntries
{α : Type u}
[Hashable α]
(i : Nat)
(source : Array (List α))
(target : Lean.HashSetBucket α)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.HashSetImp.expand
{α : Type u}
[Hashable α]
(size : Nat)
(buckets : Lean.HashSetBucket α)
:
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- mkWff: ∀ {α : Type u} [inst : BEq α] [inst_1 : Hashable α] (n : Nat), (Lean.mkHashSetImp n).WellFormed
- insertWff: ∀ {α : Type u} [inst : BEq α] [inst_1 : Hashable α] (m : Lean.HashSetImp α) (a : α), m.WellFormed → (m.insert a).WellFormed
- eraseWff: ∀ {α : Type u} [inst : BEq α] [inst_1 : Hashable α] (m : Lean.HashSetImp α) (a : α), m.WellFormed → (m.erase a).WellFormed
Instances For
@[deprecated Std.HashSet.empty]
Instances For
Equations
- Lean.HashSet.instEmptyCollection = { emptyCollection := Lean.mkHashSet }
@[inline]
Instances For
@[inline]
Equations
- Lean.HashSet.erase ⟨m_2, hw⟩ a = ⟨m_2.erase a, ⋯⟩
Instances For
@[inline]
def
Lean.HashSet.find?
{α : Type u}
{x✝ : BEq α}
{x✝¹ : Hashable α}
(m : Lean.HashSet α)
(a : α)
:
Option α
Equations
- Lean.HashSet.find? ⟨m_2, hw⟩ a = m_2.find? a
Instances For
@[inline]
def
Lean.HashSet.contains
{α : Type u}
{x✝ : BEq α}
{x✝¹ : Hashable α}
(m : Lean.HashSet α)
(a : α)
:
Equations
- Lean.HashSet.contains ⟨m_2, hw⟩ a = m_2.contains a
Instances For
@[inline]
def
Lean.HashSet.foldM
{α : Type u}
{x✝ : BEq α}
{x✝¹ : Hashable α}
{δ : Type w}
{m : Type w → Type w}
[Monad m]
(f : δ → α → m δ)
(init : δ)
(h : Lean.HashSet α)
:
m δ
Equations
- Lean.HashSet.foldM f init ⟨m_2, hw⟩ = Lean.HashSetImp.foldM f init m_2
Instances For
@[inline]
def
Lean.HashSet.fold
{α : Type u}
{x✝ : BEq α}
{x✝¹ : Hashable α}
{δ : Type w}
(f : δ → α → δ)
(init : δ)
(m : Lean.HashSet α)
:
δ
Equations
- Lean.HashSet.fold f init ⟨m_2, hw⟩ = Lean.HashSetImp.fold f init m_2
Instances For
instance
Lean.HashSet.instForM
{α : Type u}
{x✝ : BEq α}
{x✝¹ : Hashable α}
{m : Type u_1 → Type u_1}
:
ForM m (Lean.HashSet α) α
instance
Lean.HashSet.instForIn
{α : Type u}
{x✝ : BEq α}
{x✝¹ : Hashable α}
{m : Type (max u_1 u_2) → Type u_1}
:
ForIn m (Lean.HashSet α) α
@[inline]
Equations
- Lean.HashSet.size ⟨{ size := sz, buckets := buckets }, property⟩ = sz
Instances For
@[inline]
Instances For
Equations
- m.toList = Lean.HashSet.fold (fun (r : List α) (a : α) => a :: r) [] m
Instances For
Instances For
Equations
- m.numBuckets = m.val.buckets.val.size
Instances For
def
Lean.HashSet.insertMany
{α : Type u}
{x✝ : BEq α}
{x✝¹ : Hashable α}
{ρ : Type u_1}
[ForIn Id ρ α]
(s : Lean.HashSet α)
(as : ρ)
:
Insert many elements into a HashSet.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
O(|t|)
amortized. Merge two HashSet
s.
Equations
- s.merge t = Lean.HashSet.fold (fun (s : Lean.HashSet α) (a : α) => s.insert a) s t