Releases: dashjay/xiter
Releases · dashjay/xiter
Release v0.0.6
Add more implements
Implement more on xslice
Compact like https://github.com/samber/lo?tab=readme-ov-file#compact which can keep only non-zero value
First, FirstO like https://github.com/samber/lo?tab=readme-ov-file#first
Last like https://github.com/samber/lo?tab=readme-ov-file#first
Difference
Union
Intersect
v0.0.4
v0.0.3
v0.0.2
implement xiter base
func Concat[V any](seqs ...Seq[V])
func Concat2[K, V any](seqs ...Seq2[K, V])
func Equal[V comparable](x, y Seq[V])
func Equal2[K, V comparable](x, y Seq2[K, V])
func EqualFunc[V1, V2 any](x Seq[V1], y Seq[V2], f func(V1, V2) bool)
func EqualFunc2[K1, V1, K2, V2 any](x Seq2[K1, V1], y Seq2[K2, V2], f func(K1, V1, K2, V2) bool)
func Filter[V any](f func(V) bool, seq Seq[V])
func Filter2[K, V any](f func(K, V) bool, seq Seq2[K, V])
func Limit[V any](seq Seq[V], n int)
func Limit2[K, V any](seq Seq2[K, V], n int)
func Map[In, Out any](f func(In) Out, seq Seq[In])
func Merge[V cmp.Ordered](x, y Seq[V])
func MergeFunc[V any](x, y Seq[V], f func(V, V) int)
func Merge2[K cmp.Ordered, V any](x, y Seq2[K, V])
func MergeFunc2[K, V any](x, y Seq2[K, V], f func(K, K) int)
func Reduce[Sum, V any](f func(Sum, V) Sum, sum Sum, seq Seq[V])
func Reduce2[Sum, K, V any](f func(Sum, K, V) Sum, sum Sum, seq Seq2[K, V])
func Zip[V1, V2 any](x Seq[V1], y Seq[V2])
func Zip2[K1, V1, K2, V2 any](x Seq2[K1, V1], y Seq2[K2, V2])
func ToSlice[T any](seq Seq[T]) (out []T)
func ToSliceSeq2Key[K, V any](seq Seq2[K, V]) (out []K)
func ToSliceSeq2Value[K, V any](seq Seq2[K, V]) (out []V)
func Seq2KeyToSeq[K, V any](in Seq2[K, V])
func Seq2ValueToSeq[K, V any](in Seq2[K, V])
func ToMap[K comparable, V any](seq Seq2[K, V]) (out map[K]V)
func FromMapKeys[K comparable, V any](m map[K]V)
func FromMapValues[K comparable, V any](m map[K]V)
func FromMapKeyAndValues[K comparable, V any](m map[K]V)
func Pull[V any](seq Seq[V]) (next func() (V, bool), stop func())
func Pull2[K, V any](seq Seq2[K, V]) (next func() (K, V, bool), stop func())
func AllFromSeq[T any](seq Seq[T], f func(T) bool)
func AnyFromSeq[T any](seq Seq[T], f func(T) bool)
func AvgFromSeq[T constraints.Number](seq Seq[T])
func AvgByFromSeq[V any, T constraints.Number](seq Seq[V], f func(V) T)
func Contains[T comparable](seq Seq[T], in T)
func ContainsBy[T any](seq Seq[T], f func(T) bool)
func ContainsAny[T comparable](seq Seq[T], in []T)
func ContainsAll[T comparable](seq Seq[T], in []T)
func Count[T any](seq Seq[T])
func Find[T any](seq Seq[T], f func(T) bool) (val T, found bool)
func FindO[T any](seq Seq[T], f func(T) bool)
func ForEach[T any](seq Seq[T], f func(T) bool)
func ForEachIdx[T any](seq Seq[T], f func(idx int, v T) bool)
func HeadO[T any](seq Seq[T])
func Head[T any](seq Seq[T]) (v T, hasOne bool)
func Join[T ~string](seq Seq[T], sep T)
func Max[T constraints.Ordered](seq Seq[T]) (r optional.O[T])
func MaxBy[T constraints.Ordered](seq Seq[T], less func(T, T) bool) (r optional.O[T])
func Min[T constraints.Ordered](seq Seq[T]) (r optional.O[T])
func MinBy[T constraints.Ordered](seq Seq[T], less func(T, T) bool) (r optional.O[T])
func ToSliceN[T any](seq Seq[T], n int) (out []T)
func Skip[T any](seq Seq[T], n int)
func Replace[T comparable](seq Seq[T], from, to T, n int)
func ReplaceAll[T comparable](seq Seq[T], from, to T)
func FromSliceShuffle[T any](in []T)