Documentation
¶
Index ¶
- func Chunk[T any](size int) func([]T) ([][]T, error)
- func Contains[T comparable](element T) func([]T) (bool, error)
- func DistinctBy[T any, K comparable](key func(T) K) func([]T) ([]T, error)
- func Filter[T any](f func(T) bool) func([]T) ([]T, error)
- func ForEach[T any](action func(T)) func([]T) ([]T, error)
- func GroupBy[T any, K comparable](f func(T) K) func([]T) ([]T, error)
- func GroupCountBy[T any, K comparable](key func(T) K) func([]T) (map[K]int, error)
- func GroupReduceBy[T any, K comparable, A any](key func(T) K, reduce func(A, T) A) func([]T) (map[K]A, error)
- func GroupStatsBy[T any, K comparable, V Number](key func(T) K, value func(T) V) func([]T) (map[K]array.GroupStats[V], error)
- func GroupSumBy[T any, K comparable, V Number](key func(T) K, value func(T) V) func([]T) (map[K]V, error)
- func GroupSumByWhere[T any, K comparable, V Number](where func(T) bool, key func(T) K, value func(T) V) func([]T) (map[K]V, error)
- func IndexBy[T any, K comparable](key func(T) K) func([]T) (map[K]T, error)
- func IndexOf[T comparable](element T) func([]T) (int, error)
- func Join[T any](sep string) func([]T) (string, error)
- func Map[T any, U any](f func(T) U) func([]T) ([]U, error)
- func Max[T Number]() func([]T) (T, error)
- func Min[T Number]() func([]T) (T, error)
- func Partition[T any](f func(T) bool) func([]T) ([]T, []T, error)
- func Pop[T any]() func([]T) (T, []T, error)
- func Product[T Number]() func([]T) (T, error)
- func Push[T any](elements ...T) func([]T) ([]T, error)
- func Reduce[T any](f func(T, T) T) func([]T) (T, error)
- func Reverse[T any]() func([]T) ([]T, error)
- func Shift[T any]() func([]T) (T, []T, error)
- func Shuffle[T any]() func([]T) ([]T, error)
- func Skip[T any](n int) func([]T) ([]T, error)
- func Sort[T any](less func(i, j T) bool) func([]T) ([]T, error)
- func SortBy[T any, K cmp.Ordered](key func(T) K) func([]T) ([]T, error)
- func Sum[T Number]() func([]T) (T, error)
- func Take[T any](n int) func([]T) ([]T, error)
- func Unique[T comparable]() func([]T) ([]T, error)
- func Unshift[T any](elements ...T) func([]T) ([]T, error)
- type Number
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](element T) func([]T) (bool, error)
Contains adapts the contains function for pipeline use.
func DistinctBy ¶ added in v1.0.3
func DistinctBy[T any, K comparable](key func(T) K) func([]T) ([]T, error)
func ForEach ¶
ForEach adapts the forEach function for pipeline use. Nota: Embora ForEach não retorne um valor, para manter a assinatura consistente, retornaremos a própria slice e nil para o erro.
func GroupBy ¶
func GroupBy[T any, K comparable](f func(T) K) func([]T) ([]T, error)
func GroupCountBy ¶ added in v1.0.3
func GroupCountBy[T any, K comparable](key func(T) K) func([]T) (map[K]int, error)
func GroupReduceBy ¶ added in v1.0.3
func GroupReduceBy[T any, K comparable, A any](key func(T) K, reduce func(A, T) A) func([]T) (map[K]A, error)
func GroupStatsBy ¶ added in v1.0.3
func GroupStatsBy[T any, K comparable, V Number](key func(T) K, value func(T) V) func([]T) (map[K]array.GroupStats[V], error)
func GroupSumBy ¶ added in v1.0.3
func GroupSumBy[T any, K comparable, V Number](key func(T) K, value func(T) V) func([]T) (map[K]V, error)
func GroupSumByWhere ¶ added in v1.0.3
func GroupSumByWhere[T any, K comparable, V Number](where func(T) bool, key func(T) K, value func(T) V) func([]T) (map[K]V, error)
func IndexBy ¶ added in v1.0.3
func IndexBy[T any, K comparable](key func(T) K) func([]T) (map[K]T, error)
func IndexOf ¶
func IndexOf[T comparable](element T) func([]T) (int, error)
IndexOf adapts the indexOf function for pipeline use.
func Sort ¶
Sort adapts the sort function for pipeline use. Sort adapts the sort function for pipeline use, requiring a comparison function.
func Unique ¶
func Unique[T comparable]() func([]T) ([]T, error)
Unique adapts the unique function for pipeline use.
Types ¶
Click to show internal directories.
Click to hide internal directories.