seqs

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All[T any](s []T, f seq.Func[T, bool]) bool

func Any

func Any[T any](s []T, f seq.Func[T, bool]) bool

func Average

func Average[T seq.Number](s []T) T

func AverageFunc

func AverageFunc[T any, A seq.Number](s []T, f seq.Func[T, A]) A

func Chunk

func Chunk[T any](s []T, size int) iter.Seq[[]T]

func Combinations

func Combinations[T any](s []T, size int) iter.Seq[[]T]

func Concat

func Concat[T any](ss ...[]T) iter.Seq[T]

func CountBy

func CountBy[T any, K comparable](s []T, f seq.Func[T, K]) map[K]int

func CountFunc

func CountFunc[T any](s []T, f seq.Func[T, bool]) int

func Distinct

func Distinct[T comparable](s []T) iter.Seq[T]

func DistinctBy

func DistinctBy[T any, K comparable](s []T, f seq.Func[T, K]) iter.Seq[T]

func DistinctFunc

func DistinctFunc[T any, K comparable](s []T, f seq.Func[T, K]) iter.Seq[K]

func DistinctUntilChanged

func DistinctUntilChanged[T comparable](s []T) iter.Seq[T]

func DistinctUntilChangedFunc

func DistinctUntilChangedFunc[T any, K comparable](s []T, f seq.Func[T, K]) iter.Seq[T]

func Except

func Except[T comparable](s1 iter.Seq[T], s2 iter.Seq[T]) iter.Seq[T]

func ExceptFunc

func ExceptFunc[T any, K comparable](s1 []T, s2 []T, f seq.Func[T, K]) iter.Seq[T]

func Expand

func Expand[T any](s []T, f func(T) iter.Seq[T]) iter.Seq[T]

func Filter

func Filter[T any](s []T, f seq.Func[T, bool]) iter.Seq[T]

func Find

func Find[T any](s []T, f seq.Func[T, bool]) (val T, index int)

func FlatMap

func FlatMap[T, C any](s []T, subcoll seq.Func[T, iter.Seq[C]]) iter.Seq[C]

func FlatMapR

func FlatMapR[T, C, R any](s []T, subcoll seq.Func[T, iter.Seq[C]], result seq.Func2[T, C, R]) iter.Seq[R]

func GroupBy

func GroupBy[T any, K comparable](s []T, f seq.Func[T, K]) map[K][]T

func GroupByV

func GroupByV[T any, K comparable, V any](s []T, keyFunc seq.Func[T, K], valueFunc seq.Func[T, V]) map[K][]V

func Interleave

func Interleave[T any](ss ...[]T) iter.Seq[T]

func Interpose

func Interpose[T any](s []T, sep T) iter.Seq[T]

func Intersect

func Intersect[T comparable](s1 iter.Seq[T], s2 iter.Seq[T]) iter.Seq[T]

func IntersectFunc

func IntersectFunc[T any, K comparable](s1 []T, s2 []T, f seq.Func[T, K]) iter.Seq[T]

func Join

func Join[T1 any, T2 any, K comparable](s1 []T1, s2 []T2, key1 seq.Func[T1, K], key2 seq.Func[T2, K]) iter.Seq2[T1, T2]

func JoinFunc

func JoinFunc[T1 any, T2 any, K comparable, R any](s1 []T1, s2 []T2, key1 seq.Func[T1, K], key2 seq.Func[T2, K], result seq.Func2[T1, T2, R]) iter.Seq[R]

func Map

func Map[T, R any](s []T, f seq.Func[T, R]) []R

func Pairwise

func Pairwise[T any](s []T) iter.Seq2[T, T]

func PairwiseFunc

func PairwiseFunc[T, R any](s []T, f seq.Func2[T, T, R]) iter.Seq[R]

func PartitionBy

func PartitionBy[T any, V comparable](s []T, f seq.Func[T, V]) iter.Seq[[]T]

func Reduce

func Reduce[T any](s []T, f seq.Func2[T, T, T]) T

func ReduceA

func ReduceA[T, A any](s []T, f seq.Func2[A, T, A], initValue A) A

func Repeat

func Repeat[T any](s []T, count int) iter.Seq[T]

func Scan

func Scan[T, A any](s []T, f seq.Func2[A, T, A], initValue A) iter.Seq[A]

func Skip

func Skip[T any](s []T, count int) iter.Seq[T]

func SkipWhile

func SkipWhile[T any](s []T, f seq.Func[T, bool]) iter.Seq[T]

func Sum

func Sum[T cmp.Ordered](s []T) T

func SumFunc

func SumFunc[T any, A cmp.Ordered](s []T, f seq.Func[T, A]) A

func Take added in v0.0.3

func Take[T any](s []T, count int) iter.Seq[T]

func TakeWhile

func TakeWhile[T any](s []T, f seq.Func[T, bool]) iter.Seq[T]

func ToMap

func ToMap[T any, K comparable](s []T, keyFunc seq.Func[T, K]) map[K]T

func ToMapV

func ToMapV[T any, K comparable, V any](s []T, keyFunc seq.Func[T, K], valueFunc seq.Func[T, V]) map[K]V

func Union

func Union[T comparable](s1 iter.Seq[T], s2 iter.Seq[T]) iter.Seq[T]

func UnionFunc

func UnionFunc[T any, K comparable](s1 []T, s2 []T, f seq.Func[T, K]) iter.Seq[T]

func Windowed

func Windowed[T any](s []T, size int) iter.Seq[[]T]

func Zip

func Zip[T1, T2 any](s1 []T1, s2 []T2) iter.Seq2[T1, T2]

Types

This section is empty.

Jump to

Keyboard shortcuts

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