Documentation ¶
Index ¶
- func Filter[T any, IT c.Iterator[T]](elements IT, filter c.Predicate[T]) c.Iterator[T]
- func First[T any, IT c.Iterator[T]](elements IT, fit c.Predicate[T]) (T, bool)
- func Flatt[From, To any, IT c.Iterator[From]](elements IT, by c.Flatter[From, To]) c.Iterator[To]
- func FlattFit[From, To any, IT c.Iterator[From]](elements IT, fit c.Predicate[From], flatt c.Flatter[From, To]) c.Iterator[To]
- func ForEach[T any, IT c.Iterator[T]](elements IT, walker func(T))
- func ForEachFit[T any](elements c.Iterator[T], walker func(T), fit c.Predicate[T])
- func Group[T any, K comparable](elements c.Iterator[T], by c.Converter[T, K]) c.MapPipe[K, T, map[K][]T]
- func Map[From, To any, IT c.Iterator[From]](elements IT, by c.Converter[From, To]) c.Iterator[To]
- func MapFit[From, To any, IT c.Iterator[From]](elements IT, fit c.Predicate[From], by c.Converter[From, To]) c.Iterator[To]
- func NotNil[T any, IT c.Iterator[*T]](elements IT) c.Iterator[*T]
- func Of[T any](elements ...T) c.Iterator[T]
- func OfLoop[S, T any](source S, hasNext func(S) bool, getNext func(S) (T, error)) c.IteratorBreakable[T]
- func Reduce[T any, IT c.Iterator[T]](elements IT, by c.Binary[T]) T
- func ReduceKV[K, V any, IT c.KVIterator[K, V]](elements IT, by c.Quaternary[K, V]) (K, V)
- func Sum[T c.Summable, IT c.Iterator[T]](elements IT) T
- func ToPairs[T, K, V any](elements c.Iterator[T], keyExtractor c.Converter[T, K], ...) c.KVIterator[K, V]
- func ToSlice[T any](elements c.Iterator[T]) []T
- func Wrap[TS ~[]T, T any](elements TS) c.Iterator[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
Filter instantiates Iterator that checks elements by a filter and returns successful ones
func First ¶ added in v0.0.3
First returns the first element that satisfies requirements of the predicate 'fit'
func Flatt ¶
Flatt instantiates Iterator that extracts slices of 'To' by a Flatter from elements of 'From' and flattens as one iterable collection of 'To' elements
func FlattFit ¶
func FlattFit[From, To any, IT c.Iterator[From]](elements IT, fit c.Predicate[From], flatt c.Flatter[From, To]) c.Iterator[To]
FlattFit additionally filters 'From' elements
func ForEachFit ¶
ForEachFit applies a walker to elements that satisfy a predicate condition
func Group ¶
func Group[T any, K comparable](elements c.Iterator[T], by c.Converter[T, K]) c.MapPipe[K, T, map[K][]T]
Group transforms iterable elements to the MapPipe based on applying key extractor to the elements
func MapFit ¶
func MapFit[From, To any, IT c.Iterator[From]](elements IT, fit c.Predicate[From], by c.Converter[From, To]) c.Iterator[To]
MapFit additionally filters 'From' elements.
func OfLoop ¶ added in v0.0.4
func OfLoop[S, T any](source S, hasNext func(S) bool, getNext func(S) (T, error)) c.IteratorBreakable[T]
OfLoop creates an IteratorBreakable instance that loops over elements of a source The hasNext specifies a predicate that tests existing of a next element in the source. The getNext extracts the element.
func ReduceKV ¶
func ReduceKV[K, V any, IT c.KVIterator[K, V]](elements IT, by c.Quaternary[K, V]) (K, V)
ReduceKV reduces key/value elements to an one
func ToPairs ¶ added in v0.0.5
func ToPairs[T, K, V any](elements c.Iterator[T], keyExtractor c.Converter[T, K], valExtractor c.Converter[T, V]) c.KVIterator[K, V]
ToPairs converts a c.Iterator to a c.KVIterator using key and value extractors
Types ¶
This section is empty.