Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountElements ¶
func CountElements[T comparable](xs []T) map[T]int
CountElements counts the number of times that element occurs in the slice.
func SliceToSet ¶
func SliceToSet[T comparable](xs []T) map[T]int
SliceToSet returns the set of elements in the slice where the keys in the map that return for the elements in the set.
func SubtractSet ¶
func SubtractSet[T comparable](xs, ys map[T]int) map[T]int
SubtractSet returns the set of elements in xs that are not in ys. This is the same as the "relative complement" of ys with respect to xs. The sets can be generated using SliceToSet.
func SubtractSlice ¶
func SubtractSlice[T comparable](xs, ys []T) []T
SubtractSlice returns the slice of elements in xs that are not in ys. This is the same as the "relative complement" of ys with respect to xs.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.