Documentation
¶
Index ¶
- func Collect[T, U any](s sequence.Sequence[T], initial U, process func(T, U) U) (U, error)
- func CollectErr[T, U any](s sequence.Sequence[T], initial U, process func(T, U) (U, error)) (U, error)
- func Error[T any](err error) sequence.Sequence[T]
- func Infinite[T any](t T) sequence.Sequence[T]
- func Repeat[T any](t T, n int) sequence.Sequence[T]
- func Single[T any](t T) sequence.Sequence[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Collect ¶
Collect produces a single value from a sequence. It starts with an initial output value, and for every item in the sequence the value is permuted by the process function using the item from the sequence and the current value.
func CollectErr ¶
func CollectErr[T, U any](s sequence.Sequence[T], initial U, process func(T, U) (U, error)) (U, error)
CollectErr produces a single value from a sequence. It starts with an initial output value, and for every item in the sequence the value is permuted by the process function using the item from the sequence and the current value.
The callback may return errors to stop processing, either to indicate failure, or in the case of ErrStopIteration to simply end processing.
func Infinite ¶
Infinite generates a sequence where the given value is returned forever, on each iteration of the sequence.
Types ¶
This section is empty.