This module specifies the Set API expected to be implemented by different representations.
It also provides functions that redirect to the underlying Set, allowing a developer to work with different Set implementations using one API.
To create a new set, use the new
functions defined
by each set type:
HashSet.new #=> creates an empty HashSet
In the examples below, set_impl
means a specific
Set
implementation, for example HashSet
.
Protocols
Sets are required to implement both Enumerable
and Collectable
protocols.
Match
Sets are required to implement all operations using the match (===
)
operator.