Documentation
¶
Index ¶
- Constants
- func Filter[T any](fn comb.Predicate[T]) comb.Comb[[]T, []T]
- func Find[T any](fn comb.Predicate[T]) comb.Comb[[]T, T]
- func FoldLeft[In, Out any](from Out, fn comb.Folder[In, Out]) comb.Comb[[]In, Out]
- func FoldRight[In, Out any](from Out, fn comb.Folder[In, Out]) comb.Comb[[]In, Out]
- func IndexedFind[T any](fn IndexedPredicate[T]) comb.Comb[[]T, T]
- func IndexedFoldLeft[In, Out any](from Out, fn IndexedFolder[In, Out]) comb.Comb[[]In, Out]
- func IndexedFoldRight[In, Out any](from Out, fn IndexedFolder[In, Out]) comb.Comb[[]In, Out]
- func IndexedMap[In, Out any](fn IndexedMapper[In, Out]) comb.Comb[[]In, []Out]
- func Map[In, Out any](fn comb.Mapper[In, Out]) comb.Comb[[]In, []Out]
- func Sort[T cmp.Ordered]() comb.Comb[[]T, []T]
- func SortFunc[T any](fn Compare[T]) comb.Comb[[]T, []T]
- func SortedMap[In any, Out cmp.Ordered](fn comb.Mapper[In, Out]) comb.Comb[[]In, []Out]
- func SortedMapFunc[In any, Out cmp.Ordered](fn comb.Mapper[In, Out], comp Compare[Out]) comb.Comb[[]In, []Out]
- type Compare
- type IndexedFolder
- type IndexedMapper
- type IndexedPredicate
Constants ¶
const (
// ErrElementNotFound is raised when a Find or Index fails
ErrElementNotFound = "element not found"
)
Variables ¶
This section is empty.
Functions ¶
func FoldLeft ¶
FoldLeft returns a Comb that reduces a slice using a reduction function and an initial value, operating on the elements of the slice from left to right.
func FoldRight ¶
FoldRight returns a Comb that reduces a slice using a reduction function and an initial value, operating on the elements of the slice from right to left.
func IndexedFind ¶
IndexedFind returns a Comb that finds the first element in a slice that satisfies an indexed predicate.
func IndexedFoldLeft ¶
func IndexedFoldLeft[In, Out any]( from Out, fn IndexedFolder[In, Out], ) comb.Comb[[]In, Out]
IndexedFoldLeft returns a Comb that reduces a slice using an indexed reduction function and an initial value, operating on the elements of the slice from left to right.
func IndexedFoldRight ¶
func IndexedFoldRight[In, Out any]( from Out, fn IndexedFolder[In, Out], ) comb.Comb[[]In, Out]
IndexedFoldRight returns a Comb that reduces a slice using an indexed reduction function and an initial value, operating on the elements of the slice from right to left.
func IndexedMap ¶
IndexedMap returns a Comb that maps a slice using an indexed mapping function.
Types ¶
type IndexedFolder ¶
IndexedFolder is a function type that reduces input values to an output value, providing the index of the input within its slice
type IndexedMapper ¶
IndexedMapper is a function type that maps an input value to an output value, providing the index of the input within its slice
type IndexedPredicate ¶
IndexedPredicate is a function type that tests a value against a condition with an index, providing the index of the input within its slice