Documentation
¶
Overview ¶
Package set implements a generic set type. Finally! https://en.wikipedia.org/wiki/Set_(mathematics)
Index ¶
- type Set
- func (s Set[T]) Add(items ...T) Set[T]
- func (s Set[T]) All() iter.Seq[T]
- func (s Set[T]) Clear() Set[T]
- func (s Set[T]) Contains(item T) bool
- func (s Set[T]) Difference(that Set[T]) (result Set[T])
- func (s Set[T]) Empty() bool
- func (s Set[T]) Equal(that Set[T]) bool
- func (s Set[T]) Intersection(that Set[T]) (result Set[T])
- func (s Set[T]) IsSubset(that Set[T]) bool
- func (s Set[T]) IsSuperset(that Set[T]) bool
- func (s Set[T]) Len() int
- func (s Set[T]) Remove(items ...T) Set[T]
- func (s Set[T]) Slice() (result []T)
- func (s Set[T]) SymmetricDifference(that Set[T]) (result Set[T])
- func (s Set[T]) Union(that Set[T]) (result 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 Make ¶
func Make[T comparable](size int) Set[T]
func Of ¶
func Of[T comparable](items ...T) (result Set[T])
func (Set[T]) Difference ¶
func (Set[T]) Intersection ¶
func (Set[T]) IsSuperset ¶
func (Set[T]) SymmetricDifference ¶
Click to show internal directories.
Click to hide internal directories.