Documentation ¶
Index ¶
- Variables
- type Set
- func (s Set[T]) Add(elems ...T)
- func (s Set[T]) Contains(element T) bool
- func (s Set[T]) Difference(elements ...T) Set[T]
- func (s Set[T]) Intersection(elements ...T) Set[T]
- func (s Set[T]) MarshalJSON() ([]byte, error)
- func (s Set[T]) MarshalYAML() (interface{}, error)
- func (s Set[T]) SetDifference(other Set[T]) Set[T]
- func (s Set[T]) SetIntersection(other Set[T]) Set[T]
- func (s Set[T]) SetUnion(other Set[T]) Set[T]
- func (s Set[T]) String() string
- func (s Set[T]) ThreeWay(other Set[T]) [3]Set[T]
- func (s Set[T]) Union(elements ...T) Set[T]
- func (s *Set[T]) UnmarshalJSON(data []byte) error
- func (s *Set[T]) UnmarshalYAML(value *yaml.Node) error
- type Unit
Constants ¶
This section is empty.
Variables ¶
View Source
var U = Unit{}
U is the unit
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set[T comparable] map[T]Unit
Set of T is a map from T to Unit
func KeySet ¶ added in v0.0.21
func KeySet[TK comparable, TV any, TM ~map[TK]TV](src TM) Set[TK]
func NewSet ¶
func NewSet[T comparable](elements ...T) Set[T]
NewSet creates a new set with initial elements
func (Set[T]) Difference ¶
func (Set[T]) Intersection ¶
func (Set[T]) MarshalJSON ¶
func (Set[T]) MarshalYAML ¶
func (Set[T]) SetDifference ¶
func (Set[T]) SetIntersection ¶
func (*Set[T]) UnmarshalJSON ¶
func (*Set[T]) UnmarshalYAML ¶
Click to show internal directories.
Click to hide internal directories.