Documentation ¶
Index ¶
- func Add[T comparable](s Set[T], v T)
- func Contains[T comparable](s Set[T], v T) bool
- func Equal[T comparable](s1, s2 Set[T]) bool
- func IsDisjoint[T comparable](s1, s2 Set[T]) bool
- func IsSubset[T comparable](s1, s2 Set[T]) bool
- func IsSuperset[T comparable](s1, s2 Set[T]) bool
- func Remove[T comparable](s Set[T], v T)
- func ToSlice[T comparable](s Set[T]) []T
- type Set
- func FromMapKey[K comparable, V any](m map[K]V) Set[K]
- func FromMapValue[K comparable, V comparable](m map[K]V) Set[V]
- func FromSlice[T comparable](s []T) Set[T]
- func Intersect[T comparable](s1, s2 Set[T]) Set[T]
- func New[T comparable]() Set[T]
- func Subtract[T comparable](s1, s2 Set[T]) Set[T]
- func Union[T comparable](s1, s2 Set[T]) Set[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add[T comparable](s Set[T], v T)
func Contains ¶
func Contains[T comparable](s Set[T], v T) bool
func Equal ¶
func Equal[T comparable](s1, s2 Set[T]) bool
func IsDisjoint ¶
func IsDisjoint[T comparable](s1, s2 Set[T]) bool
func IsSubset ¶
func IsSubset[T comparable](s1, s2 Set[T]) bool
func IsSuperset ¶
func IsSuperset[T comparable](s1, s2 Set[T]) bool
func Remove ¶
func Remove[T comparable](s Set[T], v T)
func ToSlice ¶
func ToSlice[T comparable](s Set[T]) []T
Types ¶
type Set ¶
type Set[T comparable] map[T]struct{}
func FromMapKey ¶
func FromMapKey[K comparable, V any](m map[K]V) Set[K]
func FromMapValue ¶
func FromMapValue[K comparable, V comparable](m map[K]V) Set[V]
func FromSlice ¶
func FromSlice[T comparable](s []T) Set[T]
func Intersect ¶
func Intersect[T comparable](s1, s2 Set[T]) Set[T]
func New ¶
func New[T comparable]() Set[T]
func Subtract ¶
func Subtract[T comparable](s1, s2 Set[T]) Set[T]
func Union ¶
func Union[T comparable](s1, s2 Set[T]) Set[T]
Click to show internal directories.
Click to hide internal directories.