Documentation
¶
Index ¶
- func Clear[T comparable](s Set[T])
- func Equal[T comparable](a Set[T], b Set[T]) bool
- func New[T comparable]() *set[T]
- func Pick[T comparable](s Set[T]) T
- func Subset[T comparable](a Set[T], b Set[T]) bool
- type Set
- func Build[T comparable](values ...T) Set[T]
- func CreateFrom[T comparable](s Set[T]) Set[T]
- func CreateWithCapacity[T comparable](n int) Set[T]
- func Difference[T comparable](a Set[T], b Set[T]) Set[T]
- func Filter[T comparable](s Set[T], f func(T) bool) Set[T]
- func Intersection[T comparable](a Set[T], b Set[T]) Set[T]
- func Map[K comparable, V comparable](s Set[K], f func(K) V) Set[V]
- func Pop[T comparable](s Set[T]) (T, Set[T])
- func Rest[T comparable](s Set[T], value T) Set[T]
- func Union[T comparable](a Set[T], b Set[T]) Set[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clear ¶
func Clear[T comparable](s Set[T])
func New ¶
func New[T comparable]() *set[T]
func Pick ¶
func Pick[T comparable](s Set[T]) T
Types ¶
type Set ¶
type Set[T comparable] interface { Add(T) Enumerate() []T Remove(T) Contains(T) bool Size() int }
func Build ¶
func Build[T comparable](values ...T) Set[T]
func CreateFrom ¶
func CreateFrom[T comparable](s Set[T]) Set[T]
func CreateWithCapacity ¶
func CreateWithCapacity[T comparable](n int) Set[T]
func Difference ¶
func Difference[T comparable](a Set[T], b Set[T]) Set[T]
The set of elements in the second set but not in the first set
func Intersection ¶
func Intersection[T comparable](a Set[T], b Set[T]) Set[T]
func Map ¶
func Map[K comparable, V comparable](s Set[K], f func(K) V) Set[V]
func Pop ¶
func Pop[T comparable](s Set[T]) (T, Set[T])
func Rest ¶
func Rest[T comparable](s Set[T], value T) Set[T]
Click to show internal directories.
Click to hide internal directories.