Documentation
¶
Index ¶
- type Counter
- func (c *Counter[T]) Add(value T)
- func (c *Counter[T]) AddAll(values ...T)
- func (c *Counter[T]) Clear()
- func (c *Counter[T]) Copy() *Counter[T]
- func (c *Counter[T]) Delete(value T)
- func (c *Counter[T]) Get(value T) int64
- func (c *Counter[T]) Items() map[T]int64
- func (c *Counter[T]) Keys() iter.Seq[T]
- func (c *Counter[T]) LeastCommon(n int) iter.Seq2[T, int64]
- func (c *Counter[T]) Len() int
- func (c *Counter[T]) MostCommon(n int) iter.Seq2[T, int64]
- func (c *Counter[T]) Sorted() []T
- func (c *Counter[T]) Subtract(other *Counter[T])
- func (c *Counter[T]) Update(other *Counter[T])
- type Set
- func (s *Set[T]) Add(items ...T)
- func (s *Set[T]) Clear()
- func (s *Set[T]) Contains(item T) bool
- func (s *Set[T]) Difference(other *Set[T]) *Set[T]
- func (s *Set[T]) Intersection(other *Set[T]) *Set[T]
- func (s *Set[T]) IsDisjoint(other *Set[T]) bool
- func (s *Set[T]) IsEmpty() bool
- func (s *Set[T]) IsSubset(other *Set[T]) bool
- func (s *Set[T]) IsSuperset(other *Set[T]) bool
- func (s *Set[T]) Len() int
- func (s *Set[T]) Remove(items ...T)
- func (s *Set[T]) ToSeq() iter.Seq[T]
- func (s *Set[T]) ToSlice() []T
- func (s *Set[T]) Union(other *Set[T]) *Set[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter[T comparable] struct { // contains filtered or unexported fields }
Counter is a map of values to their counts.
func NewCounter ¶
func NewCounter[T comparable]() *Counter[T]
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
Set is a collection of unique items.
func NewSet ¶
func NewSet[T comparable]() *Set[T]
func NewSetFromSlice ¶
func NewSetFromSlice[T comparable](items []T) *Set[T]
func (*Set[T]) Difference ¶
func (*Set[T]) Intersection ¶
func (*Set[T]) IsDisjoint ¶
func (*Set[T]) IsSuperset ¶
Click to show internal directories.
Click to hide internal directories.