Documentation
¶
Overview ¶
Package sets provides utility functions for working with sets.
Index ¶
- func Clone[V comparable](s set.Set[V]) set.Set[V]
- func Collect[V comparable](seq iter.Seq[V]) set.Set[V]
- func Difference[V comparable](s1, s2 set.Set[V]) set.Set[V]
- func Equal[V comparable](s1, s2 set.Set[V]) bool
- func HasAll[V comparable](s set.Set[V], seq iter.Seq[V]) bool
- func HasAny[V comparable](s set.Set[V], seq iter.Seq[V]) bool
- func Insert[V comparable](s set.Set[V], seq iter.Seq[V])
- func Pop[V comparable](s set.Set[V]) (V, bool)
- func TryCollect[V comparable](seq iter.Seq2[V, error]) (set.Set[V], error)
- func TryInsert[V comparable](s set.Set[V], seq iter.Seq2[V, error]) error
- func Union[V comparable](s1, s2 set.Set[V]) set.Set[V]
- func Values[V comparable](s set.Set[V]) iter.Seq[V]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Collect ¶
func Collect[V comparable](seq iter.Seq[V]) set.Set[V]
Collect collects all values from the sequence into a new set.
func Difference ¶
func Difference[V comparable](s1, s2 set.Set[V]) set.Set[V]
Difference returns a new set with all values from s1 that are not in s2.
func Equal ¶
func Equal[V comparable](s1, s2 set.Set[V]) bool
Equal returns true if the two sets are equal.
func Insert ¶
func Insert[V comparable](s set.Set[V], seq iter.Seq[V])
Insert inserts all values from the sequence into the set.
func Pop ¶
func Pop[V comparable](s set.Set[V]) (V, bool)
Pop removes and returns an arbitrary value from the set. The second return value is false if the set is empty.
func TryCollect ¶
TryCollect collects all values from the sequence into a new set. It returns the first error encountered.
func TryInsert ¶
TryInsert inserts all values from the sequence into the set. It returns the first error encountered.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.