Documentation ¶
Index ¶
- func Count[T any](col types.Collection[T], conditionFunc func(elem T) bool) int
- func CountSlice[T any](arr []T, conditionFunc func(elem T) bool) int
- func FilterFlatMapSliceTo[T any, R any](src []T, tgt types.Collection[R], filterFn func(elem T) bool, ...) int
- func FilterFlatMapTo[T any, R any](src types.Collection[T], tgt types.Collection[R], filterFn func(elem T) bool, ...) int
- func FilterMapSliceTo[T any, R any](src []T, tgt types.Collection[R], filterFn func(elem T) bool, ...) int
- func FilterMapTo[T any, R any](src types.Collection[T], tgt types.Collection[R], filterFn func(elem T) bool, ...) int
- func FilterSliceTo[T any](src []T, tgt types.Collection[T], filterFn func(elem T) bool) int
- func FilterTo[T any](src types.Collection[T], tgt types.Collection[T], filterFn func(elem T) bool) int
- func FlatMapSliceTo[T any, R any](src []T, tgt types.Collection[R], mapFn func(elem T) []R) int
- func FlatMapTo[T any, R any](src types.Collection[T], tgt types.Collection[R], mapFn func(elem T) []R) int
- func FlattenSliceTo[T any](src [][]T, tgt types.Collection[T]) int
- func FlattenTo[C types.Collection[T], T any](src types.Collection[C], tgt types.Collection[T]) int
- func MapSliceTo[T any, R any](src []T, tgt types.Collection[R], mapFn func(elem T) R) int
- func MapTo[T any, R any](src types.Collection[T], tgt types.Collection[R], mapFn func(elem T) R) int
- func Reduce[T any, R any](col types.Collection[T], identity R, reduceFn func(acc R, next T) R) R
- func ReduceSlice[T any, R any](arr []T, identity R, reduceFn func(acc R, next T) R) R
- func Sum[T constraints.Ordered](col types.Collection[T]) T
- func SumSlice[T constraints.Ordered](arr []T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Count ¶ added in v1.5.0
func Count[T any](col types.Collection[T], conditionFunc func(elem T) bool) int
func CountSlice ¶ added in v1.5.0
func FilterFlatMapSliceTo ¶ added in v1.5.0
func FilterFlatMapSliceTo[T any, R any](src []T, tgt types.Collection[R], filterFn func(elem T) bool, mapFn func(elem T) []R) int
FilterFlatMapSliceTo filters and transforms elem into another Collection, returns transformed elem count collected
func FilterFlatMapTo ¶
func FilterFlatMapTo[T any, R any](src types.Collection[T], tgt types.Collection[R], filterFn func(elem T) bool, mapFn func(elem T) []R) int
FilterFlatMapTo filters and transforms elem into another Collection, returns transformed elem count collected
func FilterMapSliceTo ¶ added in v1.5.0
func FilterMapSliceTo[T any, R any](src []T, tgt types.Collection[R], filterFn func(elem T) bool, mapFn func(elem T) R) int
FilterMapSliceTo filters and transforms elem into another Collection, returns elem count collected
func FilterMapTo ¶
func FilterMapTo[T any, R any](src types.Collection[T], tgt types.Collection[R], filterFn func(elem T) bool, mapFn func(elem T) R) int
FilterMapTo filters and transforms elem into another Collection, returns elem count collected
func FilterSliceTo ¶ added in v1.5.0
func FilterSliceTo[T any](src []T, tgt types.Collection[T], filterFn func(elem T) bool) int
FilterSliceTo filters elem into another Collection, returns elem count collected
func FilterTo ¶
func FilterTo[T any](src types.Collection[T], tgt types.Collection[T], filterFn func(elem T) bool) int
FilterTo filters elem into another Collection, returns elem count collected
func FlatMapSliceTo ¶ added in v1.5.0
func FlatMapSliceTo[T any, R any](src []T, tgt types.Collection[R], mapFn func(elem T) []R) int
FlatMapSliceTo transforms elem into another Collection, returns transformed elem count collected
func FlatMapTo ¶
func FlatMapTo[T any, R any](src types.Collection[T], tgt types.Collection[R], mapFn func(elem T) []R) int
FlatMapTo transforms elem into another Collection, returns transformed elem count collected
func FlattenSliceTo ¶ added in v1.5.0
func FlattenSliceTo[T any](src [][]T, tgt types.Collection[T]) int
func FlattenTo ¶ added in v1.5.0
func FlattenTo[C types.Collection[T], T any](src types.Collection[C], tgt types.Collection[T]) int
func MapSliceTo ¶ added in v1.5.0
func MapSliceTo[T any, R any](src []T, tgt types.Collection[R], mapFn func(elem T) R) int
MapSliceTo transforms elem into another Collection, returns elem count collected
func MapTo ¶
func MapTo[T any, R any](src types.Collection[T], tgt types.Collection[R], mapFn func(elem T) R) int
MapTo transforms elem into another Collection, returns elem count collected
func Reduce ¶ added in v1.4.0
func Reduce[T any, R any](col types.Collection[T], identity R, reduceFn func(acc R, next T) R) R
func ReduceSlice ¶ added in v1.5.0
func Sum ¶ added in v1.12.0
func Sum[T constraints.Ordered](col types.Collection[T]) T
func SumSlice ¶ added in v1.12.0
func SumSlice[T constraints.Ordered](arr []T) T
Types ¶
This section is empty.