Documentation ¶
Index ¶
- func Filter[T any](arr []T, fn func(in T, index int) bool) []T
- func Find[T any](arr []T, predict func(T) bool) T
- func FindIndex[T any](arr []T, predict func(T) bool) int
- func FindP[T any](arr []T, predict func(*T) bool) *T
- func Flat[T any](arr [][]T) []T
- func Flats[T any](arr ...[]T) []T
- func Map[I, O any](arr []I, fn func(in I, index int) O) []O
- func MapE[I, O any](arr []I, fn func(in I, index int) (O, error)) ([]O, error)
- func Reduce[I, O any](arr []I, fn func(acc O, in I, index int) O, acc O) O
- func ReduceE[I, O any](arr []I, fn func(acc O, in I, index int) (O, error), acc O) (O, error)
- func Zip[T any](args ...[]T) [][]T
- func ZipFlat[T any](args ...[]T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Find ¶ added in v0.4.40
Find returns the first element in the slice that satisfies the provided testing function. Otherwise zero value is returned.
func FindIndex ¶ added in v0.4.41
FindIndex returns the index of the first element in the slice that satisfies the provided testing function. Otherwise -1 is returned.
func FindP ¶ added in v0.4.40
FindP returns the first element in the slice that satisfies the provided testing function. Otherwise nil is returned.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.