Documentation
¶
Index ¶
- func Aggregate[Slice ~[]V, V any, T cmp.Ordered](slice Slice, f func(val1 V) (T, error)) (T, error)
- func AnySeq[S any](s iter.Seq[S]) iter.Seq[any]
- func Change[Slice ~[]V, V any](slice Slice, f func(val1 V) V) Slice
- func Chunks[Slice ~[]V, V any](slice Slice, size int) []Slice
- func Contains[V any](slice []V, f func(val V) bool) bool
- func Convert[Slice ~[]V, V any, T any](slice Slice, f func(val1 V) T) []T
- func ConvertSeq[S any, T any](s iter.Seq[S], fn func(val S) T) iter.Seq[T]
- func Count[Slice ~[]V, V any](slice Slice, f func(val V) bool) int
- func CountSeq[S any](s iter.Seq[S]) int
- func Deduplicate[Slice ~[]V, V comparable](s Slice) Slice
- func DeduplicationSeq[V comparable](s iter.Seq[V]) iter.Seq[V]
- func Delete[Slice ~[]V, V comparable](slice Slice, vals ...V) Slice
- func DuplicateSeq[V comparable](s iter.Seq[V]) iter.Seq[V]
- func Duplicates[Slice ~[]V, V comparable](slice Slice) Slice
- func Empty[Slice ~[]V, V any](slice Slice, f func(val V) bool) bool
- func FilterSeq[S any](s iter.Seq[S], fn func(S) bool) iter.Seq[S]
- func FilterStrings(s []string, p *regexp.Regexp) []string
- func First[Slice ~[]V, V any](s Slice, fn func(V) bool) (V, bool)
- func Group[S ~[]E, E any, H cmp.Ordered](s S, f func(v E) H) map[H]S
- func GroupSeq[S ~[]E, E any, H comparable](s iter.Seq[E], fn func(v E) H) iter.Seq[S]
- func Groups[Slice ~[]V, V any, K cmp.Ordered](s Slice, f func(v V) K) []Slice
- func HashSeq[E comparable](s iter.Seq[E]) iter.Seq2[uint64, E]
- func IsEmptySeq[S any](s iter.Seq[S]) bool
- func Last[Slice ~[]V, V any](s Slice, fn func(V) bool) (V, bool)
- func Pairs[T any](values ...T) [][2]T
- func PatternSeq[S any](s iter.Seq[S], pattern *regexp.Regexp) iter.Seq[S]
- func Remap[Slice ~[]V, V any, K comparable, T any](slice Slice, f func(val V) (K, T, error)) (map[K]T, error)
- func RemoveSeq[S comparable](s iter.Seq[S], g iter.Seq[S]) iter.Seq[S]
- func RemoveStrings(s []string, p *regexp.Regexp) []string
- func ReplaceFuncSeq[S any](s iter.Seq[S], fn func(val S) S) iter.Seq[S]
- func ReplaceSeq[S comparable](s iter.Seq[S], g map[S]S) iter.Seq[S]
- func Select[Slice ~[]V, V any](slice Slice, f func(val V) bool) Slice
- func SortFunc[Slice ~[]V, V any](slice Slice, f func(val1 V, val2 V) bool)
- func StringPatternSeq[S any](s iter.Seq[S], pattern string) iter.Seq[S]
- func SumFuncSeq[S any, T cmp.Ordered](s iter.Seq[S], fn func(S) (T, error)) (T, error)
- func SumSeq[S cmp.Ordered](s iter.Seq[S]) S
- func To[T any, V any, Slice ~[]V](slice Slice) []T
- func ToAny[Slice ~[]V, V any](slice Slice) []any
- func ToMap[Slice ~[]V, K comparable, V any](slice Slice, f func(val V) K) map[K]V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deduplicate ¶
func Deduplicate[Slice ~[]V, V comparable](s Slice) Slice
func DeduplicationSeq ¶
func DeduplicationSeq[V comparable](s iter.Seq[V]) iter.Seq[V]
func Delete ¶
func Delete[Slice ~[]V, V comparable](slice Slice, vals ...V) Slice
Delete returns slice without the first element that equals any of vals. The input slice is never modified; a new slice is allocated on removal.
func DuplicateSeq ¶
func DuplicateSeq[V comparable](s iter.Seq[V]) iter.Seq[V]
func Duplicates ¶
func Duplicates[Slice ~[]V, V comparable](slice Slice) Slice
Duplicates returns each value that occurs more than once, in the order of its second occurrence.
func GroupSeq ¶
GroupSeq yields the values of s grouped by fn, with groups in the order their keys first appear.
func HashSeq ¶
HashSeq yields each value with a deterministic FNV-1a hash of its %#v representation, so equal values hash the same across calls and processes. Pointer values hash by address.
func PatternSeq ¶
PatternSeq yields the values whose text matches pattern. A nil pattern matches nothing.
func Remap ¶
func Remap[Slice ~[]V, V any, K comparable, T any](slice Slice, f func(val V) (K, T, error)) (map[K]T, error)
func RemoveSeq ¶
RemoveSeq yields the values of s that are not in g. g is read once per iteration of the returned sequence, before s is consumed.
func ReplaceSeq ¶
func ReplaceSeq[S comparable](s iter.Seq[S], g map[S]S) iter.Seq[S]
func SumFuncSeq ¶
func ToMap ¶
func ToMap[Slice ~[]V, K comparable, V any](slice Slice, f func(val V) K) map[K]V
Types ¶
This section is empty.