Documentation ¶
Index ¶
- func Anys[S ~[]E, E any](ts []S) []any
- func Avg[T Number](ts []T) float64
- func Chunks[S ~[]E, E any](ts S, chunkSize int) [][]E
- func Dedup[S ~[]E, E comparable](ts S) []E
- func DedupFnc[S ~[]E, E comparable](ts S, eqFnc func(t1, t2 E) bool) []E
- func Filter[S ~[]E, E any](ts S, accept func(t E) bool) []E
- func FindDoFnc[S ~[]T, T any](ts S, fnc func(t T) bool, do func(t *T))
- func FindFnc[S ~[]T, T any](ts S, fnc func(t T) bool) (T, bool)
- func Map[T any, V any](ts []T, conv func(T) V) []V
- func Repeat[T any](t T, count int) []T
- func Sum[T Number](ts []T) T
- type Number
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dedup ¶
func Dedup[S ~[]E, E comparable](ts S) []E
func DedupFnc ¶
func DedupFnc[S ~[]E, E comparable](ts S, eqFnc func(t1, t2 E) bool) []E
Types ¶
type Number ¶
type Number interface { constraints.Integer | constraints.Float }
Click to show internal directories.
Click to hide internal directories.