Documentation
¶
Index ¶
- func Filter[T any](vs []T, f func(T) bool) []T
- func ForEach[T any](vs []T, f func(T))
- func GroupBy[K comparable, V any](vs []V, f func(V) K) map[K][]V
- func Limit[T any](vs []T, limit int) []T
- func Map[T any, R any](vs []T, f func(T) R) []R
- func Min[T any](vs []T, less func(T, T) bool) T
- func Reduce[T any, R any](vs []T, f func(T, R, int) R, initial R) R
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
Filter returns the results of the elements of this slice that match the given predicate
func ForEach ¶
func ForEach[T any](vs []T, f func(T))
ForEach performs an action for each element of this slice
func GroupBy ¶
func GroupBy[K comparable, V any](vs []V, f func(V) K) map[K][]V
GroupBy grouping elements according to a classification function, and returning the results in a Map
func Limit ¶
Limit returns the results of the elements of this slice, truncated to be no longer than maxSize in length
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.