Documentation
¶
Index ¶
- func All[E any](s Seq[E], f func(E) bool) bool
- func Any[E any](s Seq[E], f func(E) bool) bool
- func Count[E comparable](s Seq[E], value E) int
- func CountFunc[E any](s Seq[E], f func(E) bool) int
- func Find[E any](s Seq[E], f func(E) bool) (result E, ok bool)
- func Fold[E, A any](s Seq[E], init A, f func(A, E) A) A
- func ForEach[E any](s Seq[E], f func(E))
- func Index[E any](s Seq[E], f func(E) bool) (int, bool)
- func IsSorted[E cmp.Ordered](s Seq[E]) bool
- func IsSortedFunc[E any](s Seq[E], f func(E, E) int) bool
- func Max[E cmp.Ordered](s Seq[E]) (m E, hasElem bool)
- func MaxFunc[E any](s Seq[E], f func(E, E) int) (m E, hasElem bool)
- func Min[E cmp.Ordered](s Seq[E]) (m E, hasElem bool)
- func MinFunc[E any](s Seq[E], f func(E, E) int) (m E, hasElem bool)
- func Reduce[E any](s Seq[E], f func(E, E) E) (result E, hasElem bool)
- func Size[E any](s Seq[E]) int
- func TryFold[E, A any](s Seq[E], init A, f func(A, E) (A, error)) (res A, err error)
- func TryForEach[E any](s Seq[E], f func(E) error) (err error)
- type Seq
- func Distinct[E comparable](s Seq[E]) Seq[E]
- func Enumerate[E any](s Seq[E]) Seq[Tuple[int, E]]
- func Filter[E any](s Seq[E], f func(E) bool) Seq[E]
- func FlatMap[E, T any](s Seq[E], f func(E) Seq[T]) Seq[T]
- func Flatten[E any](s Seq[Seq[E]]) Seq[E]
- func Map[E, T any](s Seq[E], f func(E) T) Seq[T]
- func Skip[E any](s Seq[E], n int) Seq[E]
- func Take[E any](s Seq[E], n int) Seq[E]
- type Tuple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Count ¶
func Count[E comparable](s Seq[E], value E) int
Types ¶
type Seq ¶ added in v0.5.0
Seq is an iterator over sequences of individual values. When called as seq(yield), seq calls yield(v) for each value v in the sequence, stopping early if yield returns false.
see: https://github.com/golang/go/issues/61897
func Distinct ¶ added in v0.5.0
func Distinct[E comparable](s Seq[E]) Seq[E]
Click to show internal directories.
Click to hide internal directories.