Documentation ¶
Index ¶
- Variables
- func All[S any](src Iterer[S], predicate func(S) bool) (result bool, err error)
- func Any[S any](src Iterer[S], predicate func(S) bool) (result bool, err error)
- func Collect[S any](src Iterer[S], dst interface{ ... }) (err error)
- func Contains[S comparable](src Iterer[S], target S) (result bool, err error)
- func ElementAt[S any](src Iterer[S], idx uint) (result S, err error)
- func First[S any](src Iterer[S]) (result S, err error)
- func FirstOrDefault[S any](src Iterer[S]) (result S, err error)
- func Fold[S, R any](src Iterer[S], seed R, reducer func(R, S) R) (result R, err error)
- func Last[S any](src Iterer[S]) (result S, err error)
- func LastOrDefault[S any](src Iterer[S]) (result S, err error)
- func Len[S any](src Iterer[S]) (result int, err error)
- func Max[S constraints.Ordered](src Iterer[S]) (result S, err error)
- func Min[S constraints.Ordered](src Iterer[S]) (result S, err error)
- func Reduce[S any](src Iterer[S], reducer func(S, S) S) (result S, err error)
- func Sum[S constraints.Integer | constraints.Float](src Iterer[S]) (result S, err error)
- func ToSlice[S any](src Iterer[S]) (result []S, err error)
- type Grouping
- type Iter
- type Iterer
- func Chunk[S any](src Iterer[S], size int) Iterer[[]S]
- func Concat[S any](first Iterer[S], second Iterer[S]) Iterer[S]
- func Distinct[S comparable](src Iterer[S]) Iterer[S]
- func Empty[S any]() Iterer[S]
- func Err[S any](err error) Iterer[S]
- func Filter[S any](src Iterer[S], filter func(S) bool) Iterer[S]
- func FromMap[K comparable, V any](m map[K]V) Iterer[KeyValuePair[K, V]]
- func FromSlice[T any](values []T) Iterer[T]
- func Generate[T any](generator func() (T, bool)) Iterer[T]
- func Group[S any, K comparable](src Iterer[S], keySelector func(S) K) Iterer[Grouping[S, K]]
- func Range[T constraints.Integer | constraints.Float](from T, to T, step T) Iterer[T]
- func RangeInclusive[T constraints.Integer | constraints.Float](from T, to T, step T) Iterer[T]
- func Repeat[T any](value T, count int) Iterer[T]
- func Select[S, R any](src Iterer[S], selector func(S) R) Iterer[R]
- func SelectMany[S, R any](src Iterer[S], selector func(S) Iterer[R]) Iterer[R]
- func Skip[S any](src Iterer[S], skip int) Iterer[S]
- func Take[S any](src Iterer[S], limit int) Iterer[S]
- func Zip[S1, S2, R any](first Iterer[S1], second Iterer[S2], zipper func(S1, S2) R) Iterer[R]
- type ItererFunc
- type KeyValuePair
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyIter = errors.New("contains no elements")
View Source
var ErrOutOfRange = errors.New("out of range")
Functions ¶
func FirstOrDefault ¶
func LastOrDefault ¶
func Sum ¶
func Sum[S constraints.Integer | constraints.Float](src Iterer[S]) (result S, err error)
Types ¶
type Grouping ¶
type Grouping[S any, K comparable] struct { Key K Values []S }
type Iterer ¶
func Distinct ¶
func Distinct[S comparable](src Iterer[S]) Iterer[S]
func FromMap ¶
func FromMap[K comparable, V any](m map[K]V) Iterer[KeyValuePair[K, V]]
func Group ¶
func Group[S any, K comparable](src Iterer[S], keySelector func(S) K) Iterer[Grouping[S, K]]
func Range ¶
func Range[T constraints.Integer | constraints.Float](from T, to T, step T) Iterer[T]
func RangeInclusive ¶
func RangeInclusive[T constraints.Integer | constraints.Float](from T, to T, step T) Iterer[T]
type ItererFunc ¶
func (ItererFunc[T]) Iter ¶
func (f ItererFunc[T]) Iter() Iter[T]
type KeyValuePair ¶
type KeyValuePair[K comparable, V any] struct { Key K Value V }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.