iter

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect[V any](iter Iter[V]) (vs []V)

func Count

func Count[V any](iter Iter[V]) (count int)

func ForEach

func ForEach[V any](action func(v V), iter Iter[V])

func Reduce

func Reduce[V, R any](reducer func(cur R, v V) R, init R, iter Iter[V]) R

Types

type Iter

type Iter[V any] func() (v V, ok bool)

func Chan

func Chan[E any, CH ~chan E | ~<-chan E](ch CH) Iter[E]

func ChanCaches

func ChanCaches[E any, CH ~chan E | ~<-chan E](ch CH) Iter[E]

func CharEntries

func CharEntries(s string) Iter[strings.CharEntry]

func Chars

func Chars(s string) Iter[byte]

func Concat

func Concat[V any](is ...Iter[V]) Iter[V]

func Filter

func Filter[V any](filter func(V) bool, iter Iter[V]) Iter[V]

func Keys

func Keys[K comparable, V any](m map[K]V) Iter[K]

func Limit

func Limit[V any](limit int, iter Iter[V]) Iter[V]

func Map

func Map[I, O any](mapper func(I) O, iter Iter[I]) Iter[O]

func MapEntries

func MapEntries[K comparable, V any](m map[K]V) Iter[maps.Entry[K, V]]

func Range

func Range[I generic.Integer](size I) Iter[I]

func RuneEntries

func RuneEntries(s string) Iter[strings.RuneEntry]

func Runes

func Runes(s string) Iter[rune]

func Skip

func Skip[V any](skip int, iter Iter[V]) Iter[V]

func Slice

func Slice[E any](s []E) Iter[E]

func SliceEntries

func SliceEntries[E any](s []E) Iter[slice.Entry[E]]

func SliceP

func SliceP[E any](s []E) Iter[*E]

func SlicePEntries

func SlicePEntries[E any](s []E) Iter[slice.Entry[*E]]

func Values

func Values[K comparable, V any](m map[K]V) Iter[V]

Jump to

Keyboard shortcuts

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