Documentation
¶
Index ¶
- Variables
- func AllMatch[T any](arr []T, fn func(T) bool) bool
- func AnyMatch[T any](arr []T, fn func(T) bool) bool
- func Distinct[T comparable](arr []T) []T
- func DistinctBy[T any, V comparable](arr []T, fn func(T) V) []T
- func Filter[T any](arr []T, fn func(T) bool) []T
- func Find[T any](arr []T, fn func(T) bool) (T, error)
- func FindNth[T any](arr []T, n int, fn func(T) bool) (T, error)
- func FindNthLast[T any](arr []T, n int, fn func(T) bool) (T, error)
- func FindNthLastOpt[T any](arr []T, n int, fn func(T) bool) *optional.Optional[T]
- func FindNthOpt[T any](arr []T, n int, fn func(T) bool) *optional.Optional[T]
- func FindOpt[T any](arr []T, fn func(T) bool) *optional.Optional[T]
- func FindOrElse[T any](arr []T, def T, fn func(T) bool) T
- func ForEach[T any](arr []T, fn func(T))
- func From[T any](args ...T) []T
- func Map[T, V any](arr []T, fn func(T) V) []V
- func NoneMatch[T any](arr []T, fn func(T) bool) bool
- func Reduce[T any](arr []T, acc T, fn func(T, T) T) T
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("element not found")
Functions ¶
func Distinct ¶
func Distinct[T comparable](arr []T) []T
func DistinctBy ¶
func DistinctBy[T any, V comparable](arr []T, fn func(T) V) []T
func FindNthLastOpt ¶
func FindOrElse ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.