slicer

package
v1.0.37 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All[T comparable](x T, vs ...T) bool

func AllFn

func AllFn[T any](fn func(int, T) bool, vs ...T) bool

func AllFnErr

func AllFnErr[T any](fn func(int, T) (bool, error), vs ...T) trier.Try[bool]

func Append

func Append[T any](slice optioner.Option[[]T], elems optioner.Option[[]T]) optioner.Option[[]T]

func AppendLift

func AppendLift[T any](slice optioner.Option[[]T], elems ...T) optioner.Option[[]T]

func AppendOption

func AppendOption[T any](slice optioner.Option[[]T], elems ...optioner.Option[T]) optioner.Option[[]T]

func Chunk

func Chunk[T any](size int, elem ...T) optioner.Option[[][]T]

func Contains

func Contains[T comparable](v T, elems ...T) bool

func ContainsFn

func ContainsFn[T any](fn func(int, T) bool, elems ...T) bool

func ContainsFnErr

func ContainsFnErr[T any](fn func(int, T) (bool, error), elems ...T) trier.Try[bool]

func Dedup

func Dedup[T comparable](elems ...T) []T

func DedupFn

func DedupFn[T any, C comparable](fn func(int, T) C, elems ...T) []T

func DedupFnErr

func DedupFnErr[T any, C comparable](fn func(int, T) (C, error), elems ...T) trier.Try[[]T]

func Diff

func Diff[T comparable](as, bs []T) optioner.Option[[]T]

func DiffFn

func DiffFn[T any](as, bs []T, fn func(int, T) bool) optioner.Option[[]T]

func DiffFnErr

func DiffFnErr[T any](as, bs []T, fn func(int, T) (bool, error)) trier.Try[optioner.Option[[]T]]

func Each

func Each[T any](fn func(int, T), elems ...T)

func EachErr

func EachErr[T any](fn func(int, T) error, elems ...T) error

func Equals

func Equals[T comparable](as, bs []T) bool

func EqualsFn

func EqualsFn[T any, C comparable](fn func(int, T) C, as, bs []T) bool

func EqualsFnErr

func EqualsFnErr[T comparable, C comparable](fn func(int, T) (C, error), as, bs []T) trier.Try[bool]

func Exist

func Exist[T comparable](s T, elems ...T) bool

func ExistFn

func ExistFn[T any](fn func(int, T) bool, elems ...T) bool

func ExistFnErr

func ExistFnErr[T any](fn func(int, T) (bool, error), elems ...T) trier.Try[bool]

func Filter

func Filter[T any](fn func(int, T) bool, elems ...T) []T

func FilterErr

func FilterErr[T any](fn func(int, T) (bool, error), elems ...T) trier.Try[[]T]

func Find

func Find[T comparable](match T, elems ...T) (T, bool)

func FindFn

func FindFn[T any](fn func(int, T) bool, elems ...T) (T, bool)

func FindFnErr

func FindFnErr[T any](fn func(int, T) (bool, error), elems ...T) trier.Try[optioner.Option[T]]

func Flatten

func Flatten[T any](elems ...[]T) []T

func Fold added in v1.0.33

func Fold[I any, O any](initial O, fn func(int, O, I) O, elems ...I) O

func FoldErr added in v1.0.33

func FoldErr[I any, O any](initial O, fn func(int, O, I) (O, error), elems ...I) trier.Try[O]

func FoldLeft

func FoldLeft[I any, O any](initial O, fn func(int, O, I) O, elems ...I) O

func FoldLeftErr

func FoldLeftErr[I any, O any](initial O, fn func(int, O, I) (O, error), elems ...I) trier.Try[O]

func FoldRight

func FoldRight[I any, O any](initial O, fn func(int, O, I) O, elems ...I) O

func FoldRightErr

func FoldRightErr[I any, O any](initial O, fn func(int, O, I) (O, error), elems ...I) trier.Try[O]
func Head[T any](elems ...T) optioner.Option[T]

func Map

func Map[T any, U any](fn func(int, T) U, elems optioner.Option[[]T]) optioner.Option[[]U]

func MapErr

func MapErr[T any, U any](fn func(int, T) (U, error), elems optioner.Option[[]T]) trier.Try[optioner.Option[[]U]]

func ReduceTry

func ReduceTry[V any, A any](vs []V, fn func(V, A) (A, error), initial A) trier.Try[A]

func Tail

func Tail[T any](elems ...T) optioner.Option[T]

Types

type Slicer

type Slicer[T any] optioner.Option[[]T]

Jump to

Keyboard shortcuts

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