Documentation ¶
Overview ¶
Package stream provides helper functions for transforming a slice to a stream
Index ¶
- func Convert[FS ~[]From, From, To any](elements FS, by func(From) To) stream.Iter[To]
- func Filter[TS ~[]T, T any](elements TS, filter func(T) bool) stream.Iter[T]
- func FilterAndConvert[FS ~[]From, From, To any](elements FS, filter func(From) bool, converter func(From) To) stream.Iter[To]
- func FilterAndFlatt[FS ~[]From, From, To any](elements FS, filter func(From) bool, flattener func(From) []To) stream.Iter[To]
- func Flatt[FS ~[]From, From, To any](elements FS, by func(From) []To) stream.Iter[To]
- func NotNil[T any, TRS ~[]*T](elements TRS) stream.Iter[*T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
Convert returns a stream that applies the 'converter' function to the 'elements' slice
func Filter ¶
Filter instantiates a stream that checks elements by the 'filter' function and returns successful ones
func FilterAndConvert ¶
func FilterAndConvert[FS ~[]From, From, To any](elements FS, filter func(From) bool, converter func(From) To) stream.Iter[To]
FilterAndConvert returns a stream that filters source elements and converts them
func FilterAndFlatt ¶
func FilterAndFlatt[FS ~[]From, From, To any](elements FS, filter func(From) bool, flattener func(From) []To) stream.Iter[To]
FilterAndFlatt filters source elements and extracts slices of 'To' by the 'flattener' function
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.