Documentation ¶
Index ¶
- func Consume[T any](e Enumerable[T], n int)
- func Count[T any](e Enumerable[T]) int
- func Drain[T any](e Enumerable[T])
- func Filter[T any](e Enumerable[T], f func(T) bool) Enumerable[T]
- func Histogram[T comparable, C Number](e Enumerable[T]) map[T]C
- func Map[T, S any](e Enumerable[T], f func(T) S) Enumerable[S]
- func Max[T constraints.Ordered](e Enumerable[T]) Optional[T]
- func Min[T constraints.Ordered](e Enumerable[T]) Optional[T]
- func Sum[T Number](e Enumerable[T]) (sum T)
- func Synchronize[T any](e Enumerable[T]) Enumerable[T]
- func Unique[T comparable](e Enumerable[T]) set.Set[T]
- func Zip[T, S any](a Enumerable[T], b Enumerable[S]) Enumerable[tuple.T2[T, S]]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Histogram ¶
func Histogram[T comparable, C Number](e Enumerable[T]) map[T]C
Histogram reads all values from an enumerable and returns a map of values and their respective counts.
func Map ¶
func Map[T, S any](e Enumerable[T], f func(T) S) Enumerable[S]
Map applies a function f to every element of the enumerable e.
func Max ¶
func Max[T constraints.Ordered](e Enumerable[T]) Optional[T]
Max reads all values from an enumerable and returns the biggest one.
func Min ¶
func Min[T constraints.Ordered](e Enumerable[T]) Optional[T]
Min reads all values from an enumerable and returns the smallest one.
func Sum ¶
func Sum[T Number](e Enumerable[T]) (sum T)
Sum reads all values from an enumerable and sums them up.
func Synchronize ¶
func Synchronize[T any](e Enumerable[T]) Enumerable[T]
Synchronize makes reading the enumerable thread safe.
func Unique ¶
func Unique[T comparable](e Enumerable[T]) set.Set[T]
Unique reads all values from an enumerable and returns a set of unique values.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.