Documentation ¶
Index ¶
- func All[A any, B any](in []A, f func(A))
- func Filter[V any](slice []V, filterIn func(val V) bool) []V
- func FromMapKeys[K constraints.Ordered, V any](mm map[K]V) []K
- func FromMapValues[K constraints.Ordered, V any](mm map[K]V) []V
- func MakeMapKeys[K comparable, V any](slice []V, getKey func(V) K) map[K]V
- func Map[A any, B any](in []A, f func(A) B) []B
- func MapErr[A any, B any](in []A, f func(A) (B, error)) ([]B, error)
- func MustMakeMapKeys[K comparable, V any](slice []V, getKey func(V) K) map[K]V
- func Reduce[R any, V any](slice []V, reducer func(prev R, val V) (next R)) R
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromMapKeys ¶
func FromMapKeys[K constraints.Ordered, V any](mm map[K]V) []K
func FromMapValues ¶
func FromMapValues[K constraints.Ordered, V any](mm map[K]V) []V
func MakeMapKeys ¶
func MakeMapKeys[K comparable, V any](slice []V, getKey func(V) K) map[K]V
MakeMapKeys makes a map of provided slice and a function which returns a key value for a map given an item from a slice. If key already exists, it overrides it.
func MustMakeMapKeys ¶ added in v0.10.0
func MustMakeMapKeys[K comparable, V any](slice []V, getKey func(V) K) map[K]V
MustMakeMapKeys makes a map of provided slice and a function which returns a key value for a map given an item from a slice. If key already exists, it panics.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.