set

package
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

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]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL