Documentation ¶
Index ¶
- func All[T any](a []T, f func(e T) bool) bool
- func Chunk[T any](slice []T, chunkSize int) [][]T
- func Contains[T comparable](a []T, e T) bool
- func ContainsAll[T comparable](a []T, e []T) bool
- func ContainsAny[T comparable](a []T, e []T) bool
- func Copy[S ~[]E, E any](a S) S
- func Dedup[T any, K comparable](as []T, id func(T) K) []T
- func DedupAppend[T any, K comparable](as []T, id func(T) K, vs ...T) []T
- func DedupAppendIdentity[T comparable](as []T, vs ...T) []T
- func DedupAppender[T any, K comparable](as []T, id func(T) K, cap int) func([]T, T) []T
- func DedupAppenderIdentity[T comparable](as []T, cap int) func([]T, T) []T
- func DedupIdentity[T comparable](as []T) []T
- func Filter[S ~[]E, E any](a S, f func(E) bool) S
- func Find[T any](a []T, f func(T) bool) (T, bool)
- func FindIndex[T any](a []T, f func(T) bool) int
- func Grow[S ~[]E, E any](slice S, newCap int) S
- func GrowExtra[S ~[]E, E any](slice S, extraCap int) S
- func Last[T any](a []T) T
- func LastP[T any](a []T) *T
- func Map[T, O any](a []T, f func(T) O) []O
- func MapE[T, O any](a []T, f func(T) (O, error)) ([]O, error)
- func MapFlat[T comparable](a []T, f func(T) []T) []T
- func MapFlatE[T comparable](a []T, f func(T) ([]T, error)) ([]T, error)
- func Reduce[T any, O any](a []T, f func(O, T) O, initial O) O
- func ReduceE[T any, O any](a []T, f func(O, T) (O, error), initial O) (O, error)
- func Remove[T comparable](slice []T, e T) []T
- func RemoveIndex[T any](slice []T, s int) []T
- func Reverse[S ~[]E, E any](a S) S
- func Some[T any](a []T, f func(e T) bool) bool
- func Sort[T any](a []T, comparers ...Comparer[T])
- func SortFunc[S ~[]E, E any](x S, less func(a, b E) bool)
- func SortP[T any](a []T, comparers ...Comparer[*T])
- type Comparer
- type Group
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](a []T, e T) bool
func ContainsAll ¶
func ContainsAll[T comparable](a []T, e []T) bool
func ContainsAny ¶
func ContainsAny[T comparable](a []T, e []T) bool
func Dedup ¶
func Dedup[T any, K comparable](as []T, id func(T) K) []T
func DedupAppend ¶
func DedupAppend[T any, K comparable](as []T, id func(T) K, vs ...T) []T
func DedupAppendIdentity ¶
func DedupAppendIdentity[T comparable](as []T, vs ...T) []T
func DedupAppender ¶
func DedupAppender[T any, K comparable](as []T, id func(T) K, cap int) func([]T, T) []T
func DedupAppenderIdentity ¶
func DedupAppenderIdentity[T comparable](as []T, cap int) func([]T, T) []T
func DedupIdentity ¶
func DedupIdentity[T comparable](as []T) []T
func MapFlat ¶
func MapFlat[T comparable](a []T, f func(T) []T) []T
func MapFlatE ¶
func MapFlatE[T comparable](a []T, f func(T) ([]T, error)) ([]T, error)
func Remove ¶
func Remove[T comparable](slice []T, e T) []T
func RemoveIndex ¶
Types ¶
type Group ¶
type Group[T any, K comparable] struct { Key K Items []T }
func OrderedGroupBy ¶
func OrderedGroupBy[T any, K comparable](a []T, keyer func(T) K, less func(i, j T) bool) []Group[T, K]
Click to show internal directories.
Click to hide internal directories.