Documentation
¶
Index ¶
- func Contains[S SetType[K, V], K comparable, V any](s S, k K) bool
- func Difference[S SetType[K, V], K comparable, V any](sets ...S) S
- func Elements[S SetType[K, V], K comparable, V any](set S) []K
- func From2[S SetType[K, V], K comparable, V any](it iter.Seq2[K, V]) S
- func Insert[S SetType[K, V], K comparable, V any](s S, k K)
- func Intersection[S SetType[K, V], K comparable, V any](sets ...S) S
- func Remove[S SetType[K, V], K comparable, V any](s S, k K)
- func SymmetricDifference[S SetType[K, V], K comparable, V any](sets ...S) S
- func Union[S SetType[K, V], K comparable, V any](sets ...S) S
- type Set
- func (s Set[E]) Contains(e E) bool
- func (s Set[T]) Difference(sets ...Set[T]) Set[T]
- func (s Set[T]) Elements() []T
- func (s Set[E]) Insert(e E)
- func (s Set[T]) Intersection(sets ...Set[T]) Set[T]
- func (s Set[E]) Remove(e E)
- func (s Set[T]) SymmetricDifference(sets ...Set[T]) Set[T]
- func (s Set[T]) Union(sets ...Set[T]) Set[T]
- type SetType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Difference ¶
func Difference[S SetType[K, V], K comparable, V any](sets ...S) S
func Elements ¶
func Elements[S SetType[K, V], K comparable, V any](set S) []K
func Insert ¶
func Insert[S SetType[K, V], K comparable, V any](s S, k K)
func Intersection ¶
func Intersection[S SetType[K, V], K comparable, V any](sets ...S) S
func Remove ¶
func Remove[S SetType[K, V], K comparable, V any](s S, k K)
func SymmetricDifference ¶
func SymmetricDifference[S SetType[K, V], K comparable, V any](sets ...S) S
func Union ¶
func Union[S SetType[K, V], K comparable, V any](sets ...S) S
Types ¶
type Set ¶
type Set[E comparable] map[E]struct{}
func New ¶
func New[E comparable]() Set[E]
func (Set[T]) Difference ¶
func (Set[T]) Intersection ¶
func (Set[T]) SymmetricDifference ¶
type SetType ¶
type SetType[K comparable, V any] interface { ~map[K]V }
Click to show internal directories.
Click to hide internal directories.