array

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(a int, b int) int

func At

func At[T comparable](s []T, i int) (*T, error)

func Concat

func Concat[T comparable](s1 []T, s2 ...[]T) []T

func ConcatMut

func ConcatMut[T comparable](s1 *[]T, s2 ...[]T)

func Every

func Every[T comparable](s []T, f Predicate[T]) bool

func Fill

func Fill[T comparable](s []T, el T, startPos, endPos uint) ([]T, error)

func Filter

func Filter[T comparable](s []T, f Predicate[T]) []T

func Find

func Find[T comparable](s []T, f Predicate[T]) (*T, error)

func FindIndex

func FindIndex[T comparable](s []T, f Predicate[T]) int

func FindLast

func FindLast[T comparable](s []T, f Predicate[T]) (*T, error)

func FindLastIndex

func FindLastIndex[T comparable](s []T, f Predicate[T]) int

func Flat

func Flat[T comparable](s [][]T) []T

func ForEach

func ForEach[T comparable](s []T, f ForEachFunc[T])

func Includes

func Includes[T comparable](s []T, e T) bool

func IndexOf

func IndexOf[T comparable](s []T, e T) int

func Map

func Map[T comparable](s []T, f MapFunc[T]) []any

func MapMut

func MapMut()

func Pop

func Pop[T comparable](s []T, defaultValue T) ([]T, T, error)

func PopMut

func PopMut[T comparable](s *[]T, defaultValue T) (T, error)

func Push

func Push[T comparable](s []T, e T) []T

func PushMut

func PushMut[T comparable](s *[]T, e T)

func Reduce

func Reduce[T comparable](s []T, f ReduceFunc[T], defaultValue any) any

func ReduceStrict

func ReduceStrict[T comparable, K comparable](s []T, f ReduceStrictFunc[T, K], defaultValue K) K

func Reverse

func Reverse[T comparable](s []T) []T

func Shift

func Shift[T comparable](s []T, defaultValue T) ([]T, T, error)

func ShiftMut

func ShiftMut[T comparable](s *[]T, defaultValue T) (T, error)

func Slice

func Slice[T comparable](s []T, begin, end int) []T

func Some

func Some[T comparable](s []T, f Predicate[T]) bool

func UnShift

func UnShift[T comparable](s []T, e T) []T

func UnShiftMut

func UnShiftMut[T comparable](s *[]T, e T)

Types

type Entry

type Entry[T comparable] struct {
	// contains filtered or unexported fields
}

func Entries

func Entries[T comparable](s []T) []Entry[T]

type ForEachFunc

type ForEachFunc[T comparable] func(e T, i int, s []T)

type MapFunc

type MapFunc[T comparable] func(e T, i int, s []T) any

type Predicate

type Predicate[T comparable] func(e T, i int, s []T) bool

type ReduceFunc

type ReduceFunc[T comparable] func(acc any, e T, i int, s []T) any

type ReduceStrictFunc

type ReduceStrictFunc[T comparable, K comparable] func(acc K, e T, i int, s []T) K

Jump to

Keyboard shortcuts

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