Documentation ¶
Index ¶
- func EntriesToMap[K comparable, V any](entries []Entry[K, V]) map[K]V
- func Filter[T any](s []T, fn func(Ctx[T]) bool) []T
- func ForEach[T any](s []T, fn func(Ctx[T]))
- func Map[From any, To any](s []From, fn func(Ctx[From]) To) []To
- func Reduce[From any, To any](s []From, init To, fn func(Ctx[From], To) To) To
- type Ctx
- type Entry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EntriesToMap ¶
func EntriesToMap[K comparable, V any](entries []Entry[K, V]) map[K]V
EntriesToMap converts an array of entries back into a map
func ForEach ¶
ForEach iterates over each item of the provided array, calling the provided function for each item.
Types ¶
type Entry ¶
Entry is a struct representation of an entry in a map.
func EntriesFromMap ¶
func EntriesFromMap[K comparable, V any](m map[K]V) []Entry[K, V]
EntriesFromMap returns an array of entries, enabling maps to be used with Map/Reduce/Filter/ForEach
Click to show internal directories.
Click to hide internal directories.