Documentation
¶
Index ¶
- func Filter[T any](in []T, fn comb.Predicate[T]) []T
- func Find[T any](in []T, fn comb.Predicate[T]) (T, bool)
- func FoldLeft[In, Out any](in []In, from Out, fn comb.Folder[In, Out]) Out
- func FoldRight[In, Out any](in []In, from Out, fn comb.Folder[In, Out]) Out
- func IndexedMap[In any, Out any](in []In, fn slices.IndexedMapper[In, Out]) []Out
- func Map[In, Out any](in []In, fn comb.Mapper[In, Out]) []Out
- func MapKeys[K comparable, V any](in map[K]V) []K
- func MapValues[K comparable, V any](in map[K]V) []V
- func Sort[T cmp.Ordered](in []T) []T
- func SortFunc[T any](in []T, fn slices.Compare[T]) []T
- func SortedKeys[K cmp.Ordered, V any](in map[K]V) []K
- func SortedKeysFunc[K comparable, V any](in map[K]V, fn slices.Compare[K]) []K
- func SortedMap[In any, Out cmp.Ordered](in []In, fn comb.Mapper[In, Out]) []Out
- func SortedMapFunc[In any, Out cmp.Ordered](in []In, fn comb.Mapper[In, Out], comp slices.Compare[Out]) []Out
- func SortedValues[K comparable, V cmp.Ordered](in map[K]V) []V
- func SortedValuesFunc[K comparable, V any](in map[K]V, fn slices.Compare[V]) []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
Filter applies a predicate function to filter elements of a slice and returns the filtered slice.
func Find ¶
Find applies a predicate function to find the first element in a slice that satisfies the condition. It returns the found element and a boolean indicating if an element was found.
func FoldLeft ¶
FoldLeft applies a reduction function to reduce elements of a slice to a single result value, starting from an initial value, operating on the elements of the slice from left to right.
func FoldRight ¶
FoldRight applies a reduction function to reduce elements of a slice to a single result value, starting from an initial value, operating on the elements of the slice from right to left.
func IndexedMap ¶
func IndexedMap[In any, Out any]( in []In, fn slices.IndexedMapper[In, Out], ) []Out
IndexedMap applies an indexed mapping function to transform elements of a slice and returns the mapped slice.
func Map ¶
Map applies a mapping function to transform elements of a slice and returns the mapped slice.
func MapKeys ¶
func MapKeys[K comparable, V any](in map[K]V) []K
MapKeys extracts and returns the keys of a map as a slice, panicking if an error occurs
func MapValues ¶
func MapValues[K comparable, V any](in map[K]V) []V
MapValues extracts and returns the values of a map as a slice, panicking if an error occurs.
func SortFunc ¶
SortFunc sorts the elements of a slice using a custom comparison function and returns the sorted slice.
func SortedKeys ¶
SortedKeys extracts and returns the keys of a map as a sorted slice, panicking if an error occurs.
func SortedKeysFunc ¶
func SortedKeysFunc[K comparable, V any]( in map[K]V, fn slices.Compare[K], ) []K
SortedKeysFunc extracts and returns the keys of a map as a sorted slice using a custom comparison function, panicking if an error occurs.
func SortedMap ¶
SortedMap applies a mapping function to transform elements of a slice and returns the sorted mapped slice.
func SortedMapFunc ¶
func SortedMapFunc[In any, Out cmp.Ordered]( in []In, fn comb.Mapper[In, Out], comp slices.Compare[Out], ) []Out
SortedMapFunc applies a mapping function to transform elements of a slice and returns the sorted mapped slice using a custom comparison function for sorting.
func SortedValues ¶
func SortedValues[K comparable, V cmp.Ordered](in map[K]V) []V
SortedValues extracts and returns the values of a map as a sorted slice, panicking if an error occurs.
func SortedValuesFunc ¶
func SortedValuesFunc[K comparable, V any]( in map[K]V, fn slices.Compare[V], ) []V
SortedValuesFunc extracts and returns the values of a map as a sorted slice using a custom comparison function, panicking if an error occurs.
Types ¶
This section is empty.