instance
Lean.HashSet.instSingleton_std
{α : Type u_1}
[BEq α]
[Hashable α]
:
Singleton α (Lean.HashSet α)
Equations
- Lean.HashSet.instSingleton_std = { singleton := fun (x : α) => Lean.HashSet.empty.insert x }
Equations
- Lean.HashSet.instInsert_std = { insert := fun (a : α) (s : Lean.HashSet α) => s.insert a }
@[inline]
O(n)
. Returns true
if f
returns true
for any element of the set.
Equations
- s.any f = (s.anyM f).run
@[inline]
O(n)
. Returns true
if f
returns true
for all elements of the set.
Equations
- s.all f = (s.allM f).run
Equations
- Lean.HashSet.instBEq_std = { beq := fun (s t : Lean.HashSet α) => (s.all fun (x : α) => t.contains x) && t.all fun (x : α) => s.contains x }
@[inline]
O(1)
amortized. Similar to insert
, but also returns a Boolean flag indicating whether an
existing entry has been replaced with a => b
.
@[inline]
O(n)
. Obtain a HashSet
from an array.
Equations
- Lean.HashSet.ofArray as = Lean.HashSet.empty.insertMany as
@[inline]
O(n)
. Obtain a HashSet
from a list.
Equations
- Lean.HashSet.ofList as = Lean.HashSet.empty.insertMany as