Documentation
¶
Index ¶
- Constants
- func Contains[T any](arr []T, target T) bool
- func Copy[T any](src []T) []T
- func EqualSlices[T comparable](a, b []T) bool
- func Filter[A any](arr []A, f func(A) bool) []A
- func FilterByArray[A any, B bool](arr []A, filter []B) []A
- func Find[A any](items []A, predicate func(A) bool) (value A, found bool)
- func Fold[A, B any](arr []A, f func(B, A) B, initval B) B
- func GetElementsByIndexes[T any](arr []T, ixs []int) []T
- func GetRandomBytes(n int) []byte
- func GetRandomElements[T any](arr []T, n int, repetitions bool) []T
- func HasDuplicates[T comparable](arr []T) bool
- func HashKey(key string) int
- func Map[T any, M any](arr []T, f func(T) M) []M
- func Max[T Ordered](a, b T) T
- func Max_Branchless(a, b int) int
- func Min[T Ordered](a, b T) T
- func Min_Branchless(a, b int) int
- func Permutations[T any](arr []T) [][]T
- func RangeSlice(a, b int) []int
- func Reduce[A, B any](collection []A, accumulator func(B, A) B, initialValue B) B
- func Reverse[T any](arr []T, start, end int)
- func Rotate[T any](arr []T, k int)
- func Sequence[T Number](min, max, step T) []T
- func SubArray[T any](data []T, index int, length ...int) []T
- func Zip[T1 any, T2 any, R any](arr1 []T1, arr2 []T2, f func(T1, T2) R) []R
- type Number
- type Ordered
- type UnsignedNumber
Constants ¶
View Source
const (
MaxInt32 = int32(1<<31 - 1)
)
Variables ¶
This section is empty.
Functions ¶
func EqualSlices ¶
func EqualSlices[T comparable](a, b []T) bool
func FilterByArray ¶
func GetElementsByIndexes ¶
func GetRandomBytes ¶
func GetRandomElements ¶
func HasDuplicates ¶
func HasDuplicates[T comparable](arr []T) bool
func Max_Branchless ¶
func Min_Branchless ¶
func Permutations ¶
func Permutations[T any](arr []T) [][]T
func RangeSlice ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.