Documentation ¶
Index ¶
- func All[T constraints.Ordered](slice []T) bool
- func Any[T constraints.Ordered](slice []T) bool
- func Chunk[T any](slice []T, size int) [][]T
- func Compact[T constraints.Ordered](slice []T) []T
- func Concat[T any](slices ...[]T) []T
- func Contains[T, M any](object T, element M) bool
- func Difference[T constraints.Ordered](slice1 []T, slice2 []T) []T
- func Filter[T any](slice []T, fn func(T) bool) []T
- func Fold[T any](slice []T, empty T, fn func(a T, b T) T) T
- func ForEach[T any](slice []T, fn func(currentValue T, args ...any))
- func GroupBy[T constraints.Ordered, M constraints.Ordered](slice []T, fn func(currentValue T) M) map[M][]T
- func Intersection[T constraints.Ordered](slice1 []T, slice2 []T) []T
- func Join[T any](slice []T, delimiter string) string
- func Keys[K comparable, V any](m map[K]V) []K
- func Map[T any, M any](slice []T, fn func(currentValue T) M) []M
- func Max[T constraints.Ordered](numbers ...T) T
- func Min[T constraints.Ordered](numbers ...T) T
- func MinMax[T constraints.Ordered](numbers ...T) (min T, max T)
- func Reduce[T, M any](slice []T, fn func(M, T) M, initValue M) M
- func Sort[T constraints.Ordered](slice []T) []T
- func Ternary[T any](condition bool, exprIfTrue T, exprIfFalse T) T
- func Union[T comparable](slices ...[]T) []T
- func Unique[T comparable](slice []T) []T
- func Values[K comparable, V any](m map[K]V) []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶ added in v0.2.0
func All[T constraints.Ordered](slice []T) bool
All returns true only if every element in slice evaluates to true
func Any ¶ added in v0.2.0
func Any[T constraints.Ordered](slice []T) bool
Any returns true only if any element in slice evaluates to true
func Compact ¶
func Compact[T constraints.Ordered](slice []T) []T
func Difference ¶
func Difference[T constraints.Ordered](slice1 []T, slice2 []T) []T
func GroupBy ¶
func GroupBy[T constraints.Ordered, M constraints.Ordered]( slice []T, fn func(currentValue T) M, ) map[M][]T
func Intersection ¶
func Intersection[T constraints.Ordered](slice1 []T, slice2 []T) []T
func Join ¶ added in v0.3.0
Join creates and returns a new string by concatenating all of the elements in a slice, separated by a specified delimiter
func Keys ¶ added in v0.2.0
func Keys[K comparable, V any](m map[K]V) []K
func Max ¶
func Max[T constraints.Ordered](numbers ...T) T
func Min ¶
func Min[T constraints.Ordered](numbers ...T) T
func MinMax ¶
func MinMax[T constraints.Ordered](numbers ...T) (min T, max T)
func Sort ¶
func Sort[T constraints.Ordered](slice []T) []T
func Ternary ¶ added in v0.2.0
Ternary evaluates a bool expression and returns the result of one of the two expressions, depending on whether the bool expression evaluates to true or false
func Union ¶
func Union[T comparable](slices ...[]T) []T
func Unique ¶
func Unique[T comparable](slice []T) []T
func Values ¶ added in v0.2.0
func Values[K comparable, V any](m map[K]V) []V
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.