Documentation
¶
Index ¶
- func Chain[T any](s []T) *chain[T]
- func Clone[S ~[]E, E any](s S) *chain[E]
- func Contains[T comparable](s []T, v T) bool
- func ContainsFunc[T any](s []T, f func(elem T) bool) bool
- func Count[T comparable](s []T, v T) int
- func Every[T any](s []T, f func(elem T) bool) bool
- func Filter[T any](s []T, f func(elem T) bool) *chain[T]
- func Find[T any](s []T, f func(elem T) bool) (T, bool)
- func FindIndex[T any](s []T, f func(elem T) bool) int
- func IndexOf[T comparable](s []T, v T) int
- func Map[T any, R any](s []T, f func(elem T) R) *chain[R]
- func Pop[T any](s []T) (T, *chain[T])
- func Push[T any](s []T, v T) *chain[T]
- func RemoveDuplicates[T comparable](s []T) []T
- func Shift[T any](s []T) (T, *chain[T])
- func Some[T any](s []T, f func(elem T) bool) bool
- func Unshift[T any](s []T, v T) *chain[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](s []T, v T) bool
Contains returns true if the slice contains the element.
func ContainsFunc ¶
ContainsFunc returns true if the slice contains an element that satisfies the predicate.
func Count ¶
func Count[T comparable](s []T, v T) int
Count returns the number of a given element in the slice.
func IndexOf ¶
func IndexOf[T comparable](s []T, v T) int
IndexOf returns the index of the first occurrence of the element in the slice.
func Map ¶
Map returns a Slice chain containing the results of applying the function to each element.
func Pop ¶
func Pop[T any](s []T) (T, *chain[T])
Pop removes and returns the last element of the slice and also returns a Slice chain.
func Push ¶
func Push[T any](s []T, v T) *chain[T]
Push adds an element to the end of the slice and also returns a Slice chain.
func RemoveDuplicates ¶
func RemoveDuplicates[T comparable](s []T) []T
RemoveDuplicates returns a slice with all duplicate elements removed.
func Shift ¶
func Shift[T any](s []T) (T, *chain[T])
Shift removes and returns the first element of the slice and also returns a Slice chain.
Types ¶
This section is empty.