Documentation
¶
Overview ¶
Package apply has functions to apply transformations to slices, maps, and channels TODO indexed
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToChannel ¶
ToChannel creates a channel that has elements of the provided one, but with a transforming function applied. Does not consume the original channel, operates "on demand".
func ToKeys ¶
func ToKeys[T comparable, U comparable, V any](m map[T]V, f func(T) U) map[U]V
ToKeys applies a transforming function to a map's keys, returning a map with keys of the return type of the function
func ToSlice ¶
func ToSlice[T, U any](s []T, f func(T) U) []U
ToSlice applies a transforming function to a slice's elements, returning a slice with the return type of the function
func ToValues ¶
func ToValues[T comparable, U any, V any](m map[T]U, f func(U) V) map[T]V
ToValues applies a transforming function to a map's values, returning a map with values of the return type of the function
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.