Documentation ¶
Index ¶
- func Filter[T any](slice []T, fn func(T) (bool, error)) (result []T, err error)
- func Map[TIn any, TOut any](slice []TIn, fn func(TIn) (TOut, error)) (result []TOut, err error)
- func Reverse[T generics.LTGTConstraint](slice []T) error
- func Sort[T generics.LTGTConstraint](slice []T) error
- func SortF[T any](slice []T, fn func(T, T) (bool, error)) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
Filter returns a new slice containing only the elements of the given slice for which the given function returns true.
func Map ¶
Map returns a new slice with the results of applying the given function to each element of the given slice.
func Reverse ¶
func Reverse[T generics.LTGTConstraint](slice []T) error
Reverse sorts the given slice in descending order. The type parameter must be a native number type.
func Sort ¶
func Sort[T generics.LTGTConstraint](slice []T) error
Sort sorts the given slice in ascending order. The type parameter must be a native number type.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.