Documentation
¶
Index ¶
- Variables
- func EverySlice[T any](slice []T, isXFunc func(element T) (bool, error)) (bool, error)
- func FilterSlice[T any](slice []T, filterFunc func(T) (bool, error)) ([]T, error)
- func FlatSlice[a any](slices [][]a) (result []a)
- func MapSlice[T, R any](slice []T, mapFunc func(T) (R, error)) ([]R, error)
- func OrderedReduceSlice[T, R any](slice []T, reduceFunc func(element T, basis R) (R, error), zero R) (R, error)
- func SomeSlice[T any](slice []T, isXFunc func(element T) (bool, error)) (bool, error)
- func UnorderedReduceSlice[T, R any](slice []T, reduceFunc func(element T, basis R) (R, error), zero R) (R, error)
Constants ¶
This section is empty.
Variables ¶
var RoutineCap int = 5
Functions ¶
func EverySlice ¶
Test if Every item fulfils isXFunc criteria.
If isXFunc returns an error the item is skipped for evaluation
func FilterSlice ¶
Filter every item of the slice using the filterFunc.
If filterFunc returns an error the item is not included in the filtered slice.
func MapSlice ¶
Map every item of the slice using the mapFunc. If the mapFunc returns a err for position i the new slice returns an empty value instead of the result at position i.
func OrderedReduceSlice ¶
func OrderedReduceSlice[T, R any](slice []T, reduceFunc func(element T, basis R) (R, error), zero R) (R, error)
Reduce slice to single value using the reduceFunc. Use this if order of reduction matters. If reduceFunc returns an error the result of reduceFunc is not included in the result.
func SomeSlice ¶
Test if Some items fulfil isXFunc criteria. If isXFunc returns an error the item is skipped for evaluation
func UnorderedReduceSlice ¶
func UnorderedReduceSlice[T, R any](slice []T, reduceFunc func(element T, basis R) (R, error), zero R) (R, error)
Reduce slice to single value using the reduceFunc.
Use this order of reduction does not matter. If reduceFunc returns an error the result of reduceFunc is not included in the result.
Types ¶
This section is empty.