Documentation
¶
Overview ¶
Package xiter provides simple iterator helpers.
Index ¶
- func Filter[V any](seq iter.Seq[V], test func(v V) bool) iter.Seq[V]
- func Filter2[K, V any](seq iter.Seq2[K, V], test func(k K, v V) bool) iter.Seq2[K, V]
- func First2Ok[K, V any](seq iter.Seq2[K, V]) (K, V, bool)
- func FirstOk[V any](seq iter.Seq[V]) (V, bool)
- func Map[E, F any](seq iter.Seq[E], fn func(e E) F) iter.Seq[F]
- func Swap[K any, V any](seq iter.Seq2[K, V]) iter.Seq2[V, K]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter2 ¶ added in v0.7.0
Filter2 iterates of the (k,v) pairs of seq for which test returns true.
func First2Ok ¶
First2Ok returns the first (K, V) element produced by the it iterator as well as true; otherwise, if the iterator produced no values, it returns zero K and V, as well as false.
func FirstOk ¶
FirstOk returns the first element produced by the it iterator as well as true; otherwise, if the iterator produced no values, it returns the zero value and false.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.