Documentation

Lean.Data.HashSet

def Lean.HashSetBucket.update {α : Type u} (data : HashSetBucket α) (i : USize) (d : List α) (h : i.toNat < data.val.size) :
Equations
@[simp]
theorem Lean.HashSetBucket.size_update {α : Type u} (data : 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 (since := "2024-08-08")]
structure Lean.HashSetImp (α : Type u) :
@[deprecated Std.HashSet.Raw.empty (since := "2024-08-08")]
def Lean.mkHashSetImp {α : Type u} (capacity : Nat := 8) :
Equations
@[inline]
def Lean.HashSetImp.reinsertAux {α : Type u} (hashFn : αUInt64) (data : HashSetBucket α) (a : α) :
Equations
@[inline]
def Lean.HashSetImp.foldBucketsM {α : Type u} {δ : Type w} {m : Type w → Type w} [Monad m] (data : HashSetBucket α) (d : δ) (f : δαm δ) :
m δ
Equations
@[inline]
def Lean.HashSetImp.foldBuckets {α : Type u} {δ : Type w} (data : HashSetBucket α) (d : δ) (f : δαδ) :
δ
Equations
@[inline]
def Lean.HashSetImp.foldM {α : Type u} {δ : Type w} {m : Type w → Type w} [Monad m] (f : δαm δ) (d : δ) (h : HashSetImp α) :
m δ
Equations
@[inline]
def Lean.HashSetImp.fold {α : Type u} {δ : Type w} (f : δαδ) (d : δ) (m : HashSetImp α) :
δ
Equations
@[inline]
def Lean.HashSetImp.forBucketsM {α : Type u} {m : Type w → Type w} [Monad m] (data : HashSetBucket α) (f : αm PUnit) :
Equations
@[inline]
def Lean.HashSetImp.forM {α : Type u} {m : Type w → Type w} [Monad m] (f : αm PUnit) (h : HashSetImp α) :
Equations
def Lean.HashSetImp.find? {α : Type u} [BEq α] [Hashable α] (m : HashSetImp α) (a : α) :
Equations
def Lean.HashSetImp.contains {α : Type u} [BEq α] [Hashable α] (m : HashSetImp α) (a : α) :
Equations
@[irreducible]
def Lean.HashSetImp.moveEntries {α : Type u} [Hashable α] (i : Nat) (source : Array (List α)) (target : HashSetBucket α) :
Equations
  • One or more equations did not get rendered due to their size.
def Lean.HashSetImp.expand {α : Type u} [Hashable α] (size : Nat) (buckets : HashSetBucket α) :
Equations
def Lean.HashSetImp.insert {α : Type u} [BEq α] [Hashable α] (m : HashSetImp α) (a : α) :
Equations
  • One or more equations did not get rendered due to their size.
def Lean.HashSetImp.erase {α : Type u} [BEq α] [Hashable α] (m : HashSetImp α) (a : α) :
Equations
  • One or more equations did not get rendered due to their size.
inductive Lean.HashSetImp.WellFormed {α : Type u} [BEq α] [Hashable α] :
@[deprecated Std.HashSet (since := "2024-08-08")]
def Lean.HashSet (α : Type u) [BEq α] [Hashable α] :
Equations
@[deprecated Std.HashSet.empty (since := "2024-08-08")]
def Lean.mkHashSet {α : Type u} [BEq α] [Hashable α] (capacity : Nat := 8) :
Equations
@[inline, deprecated Std.HashSet.empty (since := "2024-08-08")]
def Lean.HashSet.empty {α : Type u_1} [BEq α] [Hashable α] :
Equations
@[inline]
def Lean.HashSet.insert {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} (m : HashSet α) (a : α) :
Equations
@[inline]
def Lean.HashSet.erase {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} (m : HashSet α) (a : α) :
Equations
@[inline]
def Lean.HashSet.find? {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} (m : HashSet α) (a : α) :
Equations
@[inline]
def Lean.HashSet.contains {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} (m : HashSet α) (a : α) :
Equations
@[inline]
def Lean.HashSet.foldM {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {δ : Type w} {m : Type w → Type w} [Monad m] (f : δαm δ) (init : δ) (h : HashSet α) :
m δ
Equations
@[inline]
def Lean.HashSet.fold {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {δ : Type w} (f : δαδ) (init : δ) (m : HashSet α) :
δ
Equations
@[inline]
def Lean.HashSet.forM {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : Type w → Type w} [Monad m] (h : HashSet α) (f : αm PUnit) :
Equations
instance Lean.HashSet.instForM {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : Type u_1 → Type u_1} :
ForM m (HashSet α) α
Equations
instance Lean.HashSet.instForIn {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : Type (max u_1 u_2) → Type u_1} :
ForIn m (HashSet α) α
Equations
@[inline]
def Lean.HashSet.size {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} (m : HashSet α) :
Equations
@[inline]
def Lean.HashSet.isEmpty {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} (m : HashSet α) :
Equations
def Lean.HashSet.toList {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} (m : HashSet α) :
List α
Equations
def Lean.HashSet.toArray {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} (m : HashSet α) :
Equations
def Lean.HashSet.numBuckets {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} (m : HashSet α) :
Equations
def Lean.HashSet.insertMany {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {ρ : Type u_1} [ForIn Id ρ α] (s : HashSet α) (as : ρ) :

Insert many elements into a HashSet.

Equations
  • One or more equations did not get rendered due to their size.
@[inline]
def Lean.HashSet.merge {α : Type u} [BEq α] [Hashable α] (s t : HashSet α) :

O(|t|) amortized. Merge two HashSets.

Equations