Documentation ¶
Index ¶
- func GroupBy[T any, K comparable](in Slice[T], groupOf func(x T) K) map[K]Slice[T]
- func Reduce[TIN any, TOUT any](in Slice[TIN], init TOUT, f func(init TOUT, new TIN) TOUT) TOUT
- type Set
- func (x Set[T]) All(f func(T) bool) bool
- func (x Set[T]) Any(f func(T) bool) bool
- func (s Set[K]) Contains(k K) bool
- func (x Set[T]) CountWhere(f func(T) bool) (out int)
- func (x Set[T]) Filter(f func(T) bool) Set[T]
- func (s Set[K]) Insert(k K) bool
- func (s Set[K]) Intersect(other Set[K]) Set[K]
- func (x Set[K]) String() string
- func (s Set[K]) ToSlice() (out Slice[K])
- func (s Set[K]) Union(other Set[K]) Set[K]
- type Slice
- func (x Slice[T]) All(f func(T) bool) bool
- func (x Slice[T]) Any(f func(T) bool) bool
- func (x Slice[T]) CountWhere(f func(T) bool) (out int)
- func (x Slice[T]) Filter(f func(T) bool) (res Slice[T])
- func (x Slice[T]) Reduce(init T, f func(init T, new T) T) T
- func (x Slice[T]) SortFunc(cmp func(x, y T) int) Slice[T]
- func (x Slice[T]) UniqueFunc(cmp func(x, y T) bool) Slice[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Set ¶
type Set[K comparable] map[K]bool
func NewSet ¶
func NewSet[K comparable](in ...K) Set[K]
func (Set[T]) CountWhere ¶
Click to show internal directories.
Click to hide internal directories.