Documentation ¶
Index ¶
- func All[T comparable](match T, items ...T) bool
- func AllFn[T any](fn func(T) bool, items ...T) bool
- func AllFnErr[T any](fn func(T) (bool, error), items ...T) (bool, error)
- func AllFnErrI[T any](fn func(int, T) (bool, error), items ...T) (bool, error)
- func AllFnI[T any](fn func(int, T) bool, items ...T) bool
- func Chunk[T any](size int, items ...T) [][]T
- func Contains[T comparable](match T, items ...T) bool
- func ContainsFn[T any](fn func(T) bool, items ...T) bool
- func ContainsFnErr[T any](fn func(T) (bool, error), items ...T) (bool, error)
- func ContainsFnErrI[T any](fn func(int, T) (bool, error), items ...T) (bool, error)
- func ContainsFnI[T any](fn func(int, T) bool, items ...T) bool
- func Copy[T any](items ...T) []T
- func Dedup[T comparable](items ...T) []T
- func DedupFn[T any, K comparable](fn func(T) K, items ...T) []T
- func DedupFnErr[T any, K comparable](fn func(T) (K, error), items ...T) ([]T, error)
- func Diff[T comparable](as, bs []T) []T
- func DiffFn[T any](as, bs []T, fn func(T, T) bool) []T
- func DiffFnErr[T any](as, bs []T, fn func(T, T) (bool, error)) ([]T, error)
- func Each[T any](fn func(T), items ...T)
- func EachErr[T any](fn func(T) error, items ...T) error
- func Equals[T comparable](as, bs []T) bool
- func EqualsFn[T comparable](as, bs []T, fn func(T, T) bool) bool
- func EqualsFnErr[T comparable](as, bs []T, fn func(T, T) (bool, error)) (bool, error)
- func Exist[T comparable](s T, items ...T) bool
- func ExistFn[T any](fn func(T) bool, items ...T) bool
- func ExistFnErr[T any](fn func(T) (bool, error), items ...T) (bool, error)
- func Filter[T any](fn func(T) bool, items ...T) []T
- func FilterErr[T any](fn func(T) (bool, error), items ...T) ([]T, error)
- func Find[T comparable](match T, items ...T) (T, bool)
- func FindFn[T any](fn func(T) bool, items ...T) (T, bool)
- func FindFnErr[T any](fn func(T) (bool, error), items ...T) (T, bool, error)
- func FirstNotZero[T comparable](items ...T) (T, bool)
- func FirstZero[T comparable](items ...T) (T, bool)
- func Flatten[T any](items ...[]T) []T
- func FlattenFn[T any, U any](fn func(vs []T) []U, items ...[]T) []U
- func FlattenFnErr[T any, U any](fn func(vs []T) ([]U, error), items ...[]T) ([]U, error)
- func FoldLeft[I any, O any](initial O, fn func(O, I) O, items ...I) O
- func FoldLeftErr[I any, O any](initial O, fn func(O, I) (O, error), items ...I) (O, error)
- func FoldLeftErrI[I any, O any](initial O, fn func(int, O, I) (O, error), items ...I) (O, error)
- func FoldLeftI[I any, O any](initial O, fn func(int, O, I) O, items ...I) O
- func FoldRight[I any, O any](initial O, fn func(O, I) O, items ...I) O
- func FoldRightErr[I any, O any](initial O, fn func(O, I) (O, error), items ...I) (O, error)
- func FoldRightErrI[I any, O any](initial O, fn func(int, O, I) (O, error), items ...I) (O, error)
- func FoldRightI[I any, O any](initial O, fn func(int, O, I) O, items ...I) O
- func Head[V any](items ...V) (V, bool)
- func Join[T any](sep string, items ...T) string
- func JoinErrFn[T any](sep string, fn func(T) (string, error), items ...T) (string, error)
- func JoinFn[T any](sep string, fn func(T) string, items ...T) string
- func Last[V any](vs ...V) (V, bool)
- func Map[T any, U any](fn func(T) U, items ...T) []U
- func MapErr[T any, U any](fn func(T) (U, error), items ...T) ([]U, error)
- func MapErrI[T any, U any](fn func(int, T) (U, error), items ...T) ([]U, error)
- func MapI[T any, U any](fn func(int, T) U, items ...T) []U
- func MapPipe[T any, U any](fns []func(T) U, items ...T) []U
- func MapPipeErr[T any, U any](fns []func(T) (U, error), items ...T) ([]U, error)
- func MapPipeErrI[T any, U any](fns []func(int, T) (U, error), items ...T) ([]U, error)
- func MapPipeI[T any, U any](fns []func(int, T) U, items ...T) []U
- func Reduce[V any, A any](initial A, vs []V, fn func(V, A) A) A
- func ReduceErr[V any, A any](vs []V, fn func(V, A) (A, error), s A) (A, error)
- func Reverse[T any](items ...T) []T
- func Sort[T constraints.Ordered](items ...T) []T
- func SortFn[T any, O constraints.Ordered](fn func(T) O, items ...T) []T
- func Tail[V any](items ...V) ([]V, bool)
- func Times[V any, O any](v V, s int, fn func(V) O) []O
- type Pipe
- type PipeErr
- type Slicer
- func (t Slicer[T]) Append(items ...T)
- func (t Slicer[T]) Chunk(size int, items ...T) [][]T
- func (t Slicer[T]) FoldLeft(initial T, fn func(T, T) T, items ...T) T
- func (t Slicer[T]) FoldLeftErr(initial T, fn func(T, T) (T, error), items ...T) (T, error)
- func (t Slicer[T]) FoldLeftErrI(initial T, fn func(int, T, T) (T, error), items ...T) (T, error)
- func (t Slicer[T]) FoldLeftI(initial T, fn func(int, T, T) T, items ...T) T
- func (t Slicer[T]) FoldRight(initial T, fn func(T, T) T, items ...T) T
- func (t Slicer[T]) FoldRightErr(initial T, fn func(T, T) (T, error), items ...T) (T, error)
- func (t Slicer[T]) FoldRightErrI(initial T, fn func(int, T, T) (T, error), items ...T) (T, error)
- func (t Slicer[T]) FoldRightI(initial T, fn func(int, T, T) T, items ...T) T
- func (t Slicer[T]) Len() int
- func (t Slicer[T]) Map(fn func(T) T) []T
- func (t Slicer[T]) MapErr(fn func(T) (T, error)) ([]T, error)
- func (t Slicer[T]) MapErrI(fn func(int, T) (T, error)) ([]T, error)
- func (t Slicer[T]) MapI(fn func(int, T) T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶
func All[T comparable](match T, items ...T) bool
func Contains ¶
func Contains[T comparable](match T, items ...T) bool
func ContainsFn ¶
func ContainsFnErrI ¶
func Dedup ¶
func Dedup[T comparable](items ...T) []T
func DedupFn ¶
func DedupFn[T any, K comparable](fn func(T) K, items ...T) []T
func DedupFnErr ¶
func DedupFnErr[T any, K comparable](fn func(T) (K, error), items ...T) ([]T, error)
func Diff ¶
func Diff[T comparable](as, bs []T) []T
func Equals ¶
func Equals[T comparable](as, bs []T) bool
func EqualsFn ¶
func EqualsFn[T comparable](as, bs []T, fn func(T, T) bool) bool
func EqualsFnErr ¶
func EqualsFnErr[T comparable](as, bs []T, fn func(T, T) (bool, error)) (bool, error)
func Exist ¶
func Exist[T comparable](s T, items ...T) bool
func Find ¶
func Find[T comparable](match T, items ...T) (T, bool)
func FirstNotZero ¶
func FirstNotZero[T comparable](items ...T) (T, bool)
func FirstZero ¶
func FirstZero[T comparable](items ...T) (T, bool)
func FlattenFnErr ¶
func FoldLeftErr ¶
func FoldLeftErrI ¶
func FoldRightErr ¶
func FoldRightErrI ¶
func FoldRightI ¶
func MapPipeErrI ¶
func Sort ¶
func Sort[T constraints.Ordered](items ...T) []T
func SortFn ¶ added in v1.0.29
func SortFn[T any, O constraints.Ordered](fn func(T) O, items ...T) []T
Types ¶
type PipeErr ¶
type PipeErr[T any] struct { // contains filtered or unexported fields }
func NewPipeErr ¶
type Slicer ¶ added in v1.0.27
type Slicer[T any] []T
func (Slicer[T]) FoldLeft ¶ added in v1.0.27
func (t Slicer[T]) FoldLeft(initial T, fn func(T, T) T, items ...T) T
func (Slicer[T]) FoldLeftErr ¶ added in v1.0.27
func (Slicer[T]) FoldLeftErrI ¶ added in v1.0.27
func (Slicer[T]) FoldRight ¶ added in v1.0.27
func (t Slicer[T]) FoldRight(initial T, fn func(T, T) T, items ...T) T
func (Slicer[T]) FoldRightErr ¶ added in v1.0.27
func (Slicer[T]) FoldRightErrI ¶ added in v1.0.27
func (Slicer[T]) FoldRightI ¶ added in v1.0.27
Click to show internal directories.
Click to hide internal directories.