Documentation ¶
Index ¶
- func Keys[K comparable, V any](m map[K]V) (keys []K)
- func MapKeys[K1 comparable, V any, K2 comparable](m1 map[K1]V, f func(K1) K2, combine func(V, V) V) (m2 map[K2]V)
- func MapValues[K comparable, A any, B any](m map[K]A, f func(A) B) (res map[K]B)
- func Merge[K comparable, V any](m1 map[K]V, m2 map[K]V, combine func(V, V) V) (m map[K]V)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapKeys ¶ added in v0.3.3
func MapKeys[K1 comparable, V any, K2 comparable](m1 map[K1]V, f func(K1) K2, combine func(V, V) V) (m2 map[K2]V)
MapKeys converts original keys to new keys.
func MapValues ¶ added in v0.3.6
func MapValues[K comparable, A any, B any](m map[K]A, f func(A) B) (res map[K]B)
MapValues converts values in the map using the provided function.
func Merge ¶
func Merge[K comparable, V any](m1 map[K]V, m2 map[K]V, combine func(V, V) V) (m map[K]V)
Merge combines two maps. Function `combine` is invoked when the same key is available in both maps.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.