Go's standard iterators iter.Seq[v] and iter.Seq2[K,V] have no function to combine
them into more useful pipelines. This lib provides that.
FilterandFilter2: Filter returns an iterator that yields only values that match a predicate function, whileFilter2does the same for key-value pairsMapandMap2: Transform values from an input sequence using a mapping function, withMap2handling key-value pairsDedupandDedup2: Remove consecutive duplicate values from a sequence using a custom equality function, withDedup2handling key-value pairsGroupandGroup2: Group consecutive elements from a sequence based on a grouping function, withGroup2handling key-value pairs and returning groups of elements with the same keyChunkandChunk2: Split the input sequence into fixed-size chunks, withChunk2handling key-value pairs and returning slices of elements of specified size. The last chunk may be smaller if the input length is not divisible by chunk size
MergeOrderedandMergeOrdered2: Merge two ordered sequences into a single sequence maintaining sort order, withMergeOrdered2handling key-value pairs
// see pipeline_test.go
s1 := slices.Values([]int{1, 2})
s2 := slices.Values([]int{2, 3})
merge := iter_lib.MergeOrdered(s1, s2, false)
pipeline := iter_lib.Dedup(merge, func (i1, i2 int) bool { return i1 == i2 })
result := slices.Collect(pipeline) // []int{1, 2, 3}