Documentation
¶
Index ¶
- func Contains[T comparable](element T) func([]T) (bool, error)
- func Filter[T any](f func(T) bool) func([]T) ([]T, error)
- func ForEach[T any](action func(T)) func([]T) ([]T, error)
- func GroupBy[T any, K comparable](f func(T) K) func([]T) ([]T, error)
- func IndexOf[T comparable](element T) func([]T) (int, error)
- func Join[T any](sep string) func([]T) (string, error)
- func Map[T any, U any](f func(T) U) func([]T) ([]U, error)
- func Max[T Number]() func([]T) (T, error)
- func Min[T Number]() func([]T) (T, error)
- func Pop[T any]() func([]T) (T, []T, error)
- func Product[T Number]() func([]T) (T, error)
- func Push[T any](elements ...T) func([]T) ([]T, error)
- func Reduce[T any](f func(T, T) T) func([]T) (T, error)
- func Reverse[T any]() func([]T) ([]T, error)
- func Shift[T any]() func([]T) (T, []T, error)
- func Shuffle[T any]() func([]T) ([]T, error)
- func Sort[T any](less func(i, j T) bool) func([]T) ([]T, error)
- func Sum[T Number]() func([]T) (T, error)
- func Unique[T comparable]() func([]T) ([]T, error)
- func Unshift[T any](elements ...T) func([]T) ([]T, error)
- type Number
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](element T) func([]T) (bool, error)
Contains adapts the contains function for pipeline use.
func ForEach ¶
ForEach adapts the forEach function for pipeline use. Nota: Embora ForEach não retorne um valor, para manter a assinatura consistente, retornaremos a própria slice e nil para o erro.
func GroupBy ¶
func GroupBy[T any, K comparable](f func(T) K) func([]T) ([]T, error)
func IndexOf ¶
func IndexOf[T comparable](element T) func([]T) (int, error)
IndexOf adapts the indexOf function for pipeline use.
func Sort ¶
Sort adapts the sort function for pipeline use. Sort adapts the sort function for pipeline use, requiring a comparison function.
func Unique ¶
func Unique[T comparable]() func([]T) ([]T, error)
Unique adapts the unique function for pipeline use.
Types ¶
Click to show internal directories.
Click to hide internal directories.