Documentation
¶
Index ¶
- func CollectMap[K cmp.Ordered, V any](seq iter.Seq2[K, V]) map[K]V
- func CollectSlice[K, V any](seq iter.Seq2[K, V]) []V
- func Filter[K, V any](seq iter.Seq2[K, V], f func(K, V) bool) iter.Seq2[K, V]
- func Map[InK, InV, OutV any](seq iter.Seq2[InK, InV], mapper func(InK, InV) OutV) iter.Seq[OutV]
- func Map2[InK, InV, OutK, OutV any](seq iter.Seq2[InK, InV], mapper func(InK, InV) (OutK, OutV)) iter.Seq2[OutK, OutV]
- func Skip[K, V any](seq iter.Seq2[K, V], num int) iter.Seq2[K, V]
- func Take[K, V any](seq iter.Seq2[K, V], num int) iter.Seq2[K, V]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectMap ¶
CollectMap collects all elements of the sequence into a map.
func CollectSlice ¶
CollectSlice collects all elements of the sequence into a slice.
func Filter ¶
Filter returns a new sequence that contains only the elements of the original sequence that satisfy the filter function. The filter function should return true for elements that should be included in the new sequence.
func Map ¶
Map returns a new sequence that contains the results of applying the mapper function to each element of the original sequence. The mapper function should return the new value for each element.
func Map2 ¶
func Map2[InK, InV, OutK, OutV any]( seq iter.Seq2[InK, InV], mapper func(InK, InV) (OutK, OutV), ) iter.Seq2[OutK, OutV]
Map2 returns a new sequence that contains the result of applying the mapper function to each element of the original sequence. The mapper function should return a key-value pair for each element.
Types ¶
This section is empty.