Documentation ¶
Index ¶
- func Count[T any](it Iter[T]) (int, error)
- func Drain[T any](it Iter[T]) error
- func Fold[T, S any](it Iter[T], fn func(S, T) (S, error), sum S) (S, error)
- func ForEach[T any](it Iter[T], fn func(T) error) error
- func ForEachN[T any](it Iter[T], fn func(T, int) error) error
- func Slice[T any](it Iter[T]) ([]T, error)
- func SortKeys[K constraints.Ordered, V any](a, b Pair[K, V]) bool
- func SortKeysDesc[K constraints.Ordered, V any](a, b Pair[K, V]) bool
- func SortValues[K comparable, V constraints.Ordered](a, b Pair[K, V]) bool
- func SortValuesDesc[K comparable, V constraints.Ordered](a, b Pair[K, V]) bool
- func Sum[N Number](it Iter[N]) (N, error)
- func ToMap[K comparable, V any](it Iter[Pair[K, V]]) (map[K]V, error)
- func UseSlice[T any](it Iter[T], fn func(s []T) error) error
- type Done
- type Doner
- type Forever
- type Iter
- func Any[T any](it Iter[T]) Iter[any]
- func Counter[N Number](start, step N) Iter[N]
- func Distinct[T comparable](it Iter[T]) Iter[T]
- func DistinctFunc[T any](it Iter[T], fn func(T, T) bool) Iter[T]
- func Error[T any](err error) Iter[T]
- func Filter[T any](it Iter[T], fn func(T) bool) Iter[T]
- func FuncIter[T any, S Doner](fn func(S) ([]T, S, error)) Iter[T]
- func Log[T any](it Iter[T], prefix string) Iter[T]
- func Map[T1, T2 any](it Iter[T1], fn func(T1) T2) Iter[T2]
- func MapErr[T1, T2 any](it Iter[T1], fn func(T1) (T2, error)) Iter[T2]
- func Partition[T any](it Iter[T], fn func([]T) ([]T, [][]T)) Iter[[]T]
- func PartitionAll[T any](it Iter[T], n int) Iter[[]T]
- func PartitionLoops[T comparable](it Iter[T]) Iter[[]T]
- func Pluck[K, V any](it Iter[V], keyFn func(V) K) Iter[Pair[K, V]]
- func PluckErr[K, V any](it Iter[V], keyFn func(V) (K, error)) Iter[Pair[K, V]]
- func Random[N constraints.Integer](min, max N) Iter[N]
- func Range[N Number](start, step N, count int) Iter[N]
- func SelectKeys[K comparable, V any](m map[K]V, keys Iter[K]) Iter[V]
- func Skip[T any](it Iter[T], n int) Iter[T]
- func SliceIter[T any](data ...T) Iter[T]
- func Take[T any](it Iter[T], n int) Iter[T]
- func Transform[T1, T2 any](it Iter[T1], fn func(T1) ([]T2, Done, error)) Iter[T2]
- func Unfold[T any, S Doner](s S, fn func(S) ([]T, S, error)) Iter[T]
- func UnfoldLens[T any, S Doner](l Lens[S], fn func(S) ([]T, S, error)) Iter[T]
- func Unique[T comparable](it Iter[T]) Iter[T]
- func UniqueFunc[T any, K comparable](it Iter[T], fn func(T) K) Iter[T]
- func WithClose[T any](it Iter[T], fn func() error) Iter[T]
- type Lens
- type Maybe
- type Number
- type Pair
- type Slicer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortKeysDesc ¶
func SortKeysDesc[K constraints.Ordered, V any](a, b Pair[K, V]) bool
func SortValues ¶
func SortValues[K comparable, V constraints.Ordered](a, b Pair[K, V]) bool
func SortValuesDesc ¶
func SortValuesDesc[K comparable, V constraints.Ordered](a, b Pair[K, V]) bool
Types ¶
type Iter ¶
func Distinct ¶
func Distinct[T comparable](it Iter[T]) Iter[T]
func PartitionLoops ¶
func PartitionLoops[T comparable](it Iter[T]) Iter[[]T]
func Random ¶
func Random[N constraints.Integer](min, max N) Iter[N]
func SelectKeys ¶
func SelectKeys[K comparable, V any](m map[K]V, keys Iter[K]) Iter[V]
func Unique ¶
func Unique[T comparable](it Iter[T]) Iter[T]
func UniqueFunc ¶
func UniqueFunc[T any, K comparable](it Iter[T], fn func(T) K) Iter[T]
type Number ¶
type Number interface { constraints.Integer | constraints.Float | constraints.Complex }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.