Documentation ¶
Index ¶
- func All[A any, B any](in []A, f func(A))
- func Filter[V any](slice []V, filters ...func(el V) bool) []V
- func FromMapKeys[K comparable, V any](mm map[K]V) []K
- func FromMapValues[K comparable, V any](mm map[K]V) []V
- func IterMapN[K comparable, V any](num int, fn func(index int) (K, V)) (res map[K]V)
- func IterN[T any](num int, fn func(index int) T) (res []T)
- 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 Reduce[R any, V any](slice []V, reducer func(prev R, val V) (next R)) R
- func ReverseInplace[V any](slice []V)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromMapKeys ¶
func FromMapKeys[K comparable, V any](mm map[K]V) []K
func FromMapValues ¶
func FromMapValues[K comparable, V any](mm map[K]V) []V
func IterMapN ¶ added in v0.4.0
func IterMapN[K comparable, V any](num int, fn func(index int) (K, V)) (res map[K]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 ReverseInplace ¶ added in v0.3.2
func ReverseInplace[V any](slice []V)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.