iter

package
v1.2.123 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter[V comparable](seq iter.Seq[V]) iter.Seq[V]

Filter returns an iterator that yields the individual values satisfying v != zero within all v in the sequences.

func Filter2

func Filter2[K, V comparable](seq iter.Seq2[K, V]) iter.Seq2[K, V]

Filter2 returns an iterator that yields the pairs of values satisfying v != zero within all [k,v] in the sequences.

func Filter2Func

func Filter2Func[K, V any](seq iter.Seq2[K, V], f func(K, V) bool) iter.Seq2[K, V]

Filter2Func returns an iterator that yields the pairs of values satisfying f(v) within all [k,v] in the sequences.

func Filter2N

func Filter2N[K, V any](seq iter.Seq2[K, V], n int) iter.Seq2[K, V]

Filter2N returns an iterator that yields the pairs of values at most in the sequences.

The count determines the number of pairs of values to return:

  • n > 0: at most n pairs of values;
  • n == 0: zero pairs of values;
  • n < 0: all pairs of values.

func FilterFunc

func FilterFunc[V any](seq iter.Seq[V], f func(V) bool) iter.Seq[V]

FilterFunc returns an iterator that yields the individual values satisfying f(v) within all v in the sequences.

func FilterN

func FilterN[V any](seq iter.Seq[V], n int) iter.Seq[V]

FilterN returns an iterator that yields the individual values at most in the sequences.

The count determines the number of individual values to return:

  • n > 0: at most n individual values;
  • n == 0: zero individual values;
  • n < 0: all individual values.

func Map

func Map[V any, M string](seq iter.Seq[V]) iter.Seq[M]

Map returns an iterator that yields the individual values mapped by format "%v" within all v in the sequences. TODO: accept [V any, M ~string] if go support template type deduction

func Map2

func Map2[K, V any, KR, KV string](seq iter.Seq2[K, V]) iter.Seq2[KR, KV]

Map2 returns an iterator that yields the pairs of values mapped by format "%v" within all [k,v] in the sequences. TODO: accept [K, V any, KR, KV ~string] if go support template type deduction

func Map2Func

func Map2Func[K, V, KR, KV any](seq iter.Seq2[K, V], f func(K, V) (KR, KV)) iter.Seq2[KR, KV]

Map2Func returns an iterator that yields the pairs of values mapped by f(k,v) within all [k,v] in the sequences.

func MapFunc

func MapFunc[V, M any](seq iter.Seq[V], f func(V) M) iter.Seq[M]

MapFunc returns an iterator that yields the individual values mapped by f(c) within all v in the sequences.

Types

This section is empty.

Jump to

Keyboard shortcuts

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