Documentation
¶
Index ¶
- type Set
- func (set Set[T]) Add(items ...T) Set[T]
- func (set Set[T]) Clone() Set[T]
- func (set Set[T]) Contains(item T) bool
- func (set Set[T]) Difference(other Set[T]) Set[T]
- func (set Set[T]) Equal(other Set[T]) bool
- func (set Set[T]) Filter(f func(v T) bool) Set[T]
- func (set Set[T]) For(f func(v T) error) error
- func (set Set[T]) Intersection(other Set[T]) Set[T]
- func (set Set[T]) IsProperSubset(other Set[T]) bool
- func (set Set[T]) IsProperSuperset(other Set[T]) bool
- func (set Set[T]) IsSubset(other Set[T]) bool
- func (set Set[T]) IsSuperset(other Set[T]) bool
- func (set Set[T]) Len() int
- func (set Set[T]) Remove(items ...T) Set[T]
- func (set Set[T]) SymmetricDifference(other Set[T]) Set[T]
- func (set Set[T]) Union(other Set[T]) Set[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set[T comparable] map[T]struct{}
func Map ¶
func Map[T, U comparable](set Set[T], mapper func(v T) U) Set[U]
Map converts all items in the set by using the mapper.
func (Set[T]) Difference ¶
Difference returns a new set with items that are included by the set but not the other.
func (Set[T]) For ¶
For calls the f for each items in the set. If the f returns an error, For stops the iteration and return the error.
func (Set[T]) Intersection ¶
Intersection returns a new set with items that are included by both of the set and the other.
func (Set[T]) IsProperSubset ¶
IsProperSubset reports whether the set is a proper subset of the other.
func (Set[T]) IsProperSuperset ¶
IsProperSuperset reports whether the set is a proper superset of the other.
func (Set[T]) IsSuperset ¶
IsSuperset reports whether the set is a superset of the other.
func (Set[T]) SymmetricDifference ¶
SymmetricDifference returns a new set.
Click to show internal directories.
Click to hide internal directories.