HashSet[A: Any #share, H: HashFunction[A] val]¶
A set, built on top of persistent Map. This is implemented as map of an alias of a type to itself.
Implements¶
- Comparable[HashSet[A, H] box] ref
Constructors¶
create¶
Returns¶
- HashSet[A, H] val^
Public Functions¶
size¶
Return the number of elements in the set.
Returns¶
- USize val
apply¶
Return the value if it is in the set, otherwise raise an error.
Parameters¶
- value: val->A
Returns¶
- val->A ?
contains¶
Check whether the set contains the value.
Parameters¶
- value: val->A
Returns¶
- Bool val
add¶
Return a set with the value added.
Parameters¶
- value: val->A
Returns¶
- HashSet[A, H] val
sub¶
Return a set with the value removed.
Parameters¶
- value: val->A
Returns¶
- HashSet[A, H] val
op_or¶
Return a set with the elements of both this and that.
Parameters¶
Returns¶
- HashSet[A, H] val
op_and¶
Return a set with the elements that are in both this and that.
Parameters¶
Returns¶
- HashSet[A, H] val
op_xor¶
Return a set with elements that are in either this or that, but not both.
Parameters¶
Returns¶
- HashSet[A, H] val
without¶
Return a set with the elements of this that are not in that.
Parameters¶
Returns¶
- HashSet[A, H] val
eq¶
Return true if this and that contain the same elements.
Parameters¶
- that: HashSet[A, H] box
Returns¶
- Bool val
lt¶
Return true if every element in this is also in that, and this has fewer elements than that.
Parameters¶
- that: HashSet[A, H] box
Returns¶
- Bool val
le¶
Return true if every element in this is also in that.
Parameters¶
- that: HashSet[A, H] box
Returns¶
- Bool val
gt¶
Return true if every element in that is also in this, and this has more elements than that.
Parameters¶
- that: HashSet[A, H] box
Returns¶
- Bool val
ge¶
Return true if every element in that is also in this.
Parameters¶
- that: HashSet[A, H] box
Returns¶
- Bool val
values¶
Return an iterator over the values in the set.
Returns¶
- Iterator[A] ref^
compare¶
Parameters¶
- that: HashSet[A, H] box
Returns¶
ne¶
Parameters¶
- that: HashSet[A, H] box
Returns¶
- Bool val