it

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter[T any, IT c.Iterator[T]](elements IT, filter c.Predicate[T]) c.Iterator[T]

Filter instantiates Iterator that checks elements by a filter and returns successful ones.

func Flatt

func Flatt[From, To any, IT c.Iterator[From]](elements IT, by c.Flatter[From, To]) c.Iterator[To]

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 ForEach

func ForEach[T any, IT c.Iterator[T]](elements IT, walker func(T))

ForEach applies a walker to elements of an Iterator.

func ForEachFit

func ForEachFit[T any](elements c.Iterator[T], walker func(T), fit c.Predicate[T])

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 Map

func Map[From, To any, IT c.Iterator[From]](elements IT, by c.Converter[From, To]) c.Iterator[To]

Map instantiates Iterator that converts elements with a converter and returns them.

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 NotNil

func NotNil[T any, IT c.Iterator[*T]](elements IT) c.Iterator[*T]

NotNil instantiates Iterator that filters nullable elements.

func Of

func Of[T any](elements ...T) c.Iterator[T]

Of instantiates Iterator of predefined elements.

func Reduce

func Reduce[T any, IT c.Iterator[T]](elements IT, by op.Binary[T]) T

Reduce reduces elements to an one.

func ReduceKV

func ReduceKV[K, V any, IT c.KVIterator[K, V]](elements IT, by op.Quaternary[K, V]) (K, V)

ReduceKV reduces key/value elements to an one.

func Slice

func Slice[T any](elements c.Iterator[T]) []T

Slice converts an Iterator to a slice.

func Wrap

func Wrap[T any, TS ~[]T](elements TS) c.Iterator[T]

Wrap instantiates Iterator using sclie as the elements source.

Types

This section is empty.

Directories

Path Synopsis
impl
it

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL