Documentation
¶
Index ¶
- func Clone[M ~map[K]V, K comparable, V any](m M) M
- func Copy[D, S ~map[K]V, K comparable, V any](dst D, src S)
- func Equal[D, S ~map[K]V, K, V comparable](dst D, src S) bool
- func EqualFunc[D ~map[K]V, S ~map[K]U, F ~func(V, U) bool, K comparable, V any, U any](dst D, src S, f F) bool
- func Keys[M ~map[K]V, K comparable, V any](m M) []K
- func Map[M ~map[K]V, F ~func(K, V) (T, U), K comparable, V any, T comparable, U any](m M, f F) map[T]U
- func MapTo[D ~map[T]U, M ~map[K]V, F ~func(K, V) (T, U), K comparable, V any, ...](d D, m M, f F) D
- func MaxKey[M ~map[K]V, K constraints.Ordered, V any](m M) K
- func MaxValue[M ~map[K]V, K comparable, V constraints.Ordered](m M) V
- func MinKey[M ~map[K]V, K constraints.Ordered, V any](m M) K
- func MinValue[M ~map[K]V, K comparable, V constraints.Ordered](m M) V
- func MinmaxKey[M ~map[K]V, K constraints.Ordered, V any](m M) (min, max K)
- func MinmaxValue[M ~map[K]V, K comparable, V constraints.Ordered](m M) (min, max V)
- func SumFunc[M ~map[K]V, F ~func(K, V) T, K comparable, V any, ...](m M, f F) T
- func SumKey[M ~map[K]V, K constraints.Number | ~string, V any](m M) K
- func SumValue[M ~map[K]V, K comparable, V constraints.Number | ~string](m M) V
- func Values[M ~map[K]V, K comparable, V any](m M) []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
func Copy[D, S ~map[K]V, K comparable, V any](dst D, src S)
Copy copies all key/value pairs in src adding them to dst.
func Equal ¶
func Equal[D, S ~map[K]V, K, V comparable](dst D, src S) bool
Equal reports whether two maps contain the same key/value pairs.
func EqualFunc ¶
func EqualFunc[ D ~map[K]V, S ~map[K]U, F ~func(V, U) bool, K comparable, V any, U any, ](dst D, src S, f F) bool
EqualFunc is like Equal, but compares values using
func Map ¶
func Map[ M ~map[K]V, F ~func(K, V) (T, U), K comparable, V any, T comparable, U any, ](m M, f F) map[T]U
Map creates a new map which values mapping from key-value pair of m by function f
func MapTo ¶
func MapTo[ D ~map[T]U, M ~map[K]V, F ~func(K, V) (T, U), K comparable, V any, T comparable, U any, ](d D, m M, f F) D
MapTo inserts pairs mapping from key-value pair of m by function f
func MaxKey ¶
func MaxKey[M ~map[K]V, K constraints.Ordered, V any](m M) K
MaxKey retrieves maxinum key of map
func MaxValue ¶
func MaxValue[M ~map[K]V, K comparable, V constraints.Ordered](m M) V
MaxValue retrieves mininum value of map
func MinKey ¶
func MinKey[M ~map[K]V, K constraints.Ordered, V any](m M) K
MinKey retrieves mininum key of map
func MinValue ¶
func MinValue[M ~map[K]V, K comparable, V constraints.Ordered](m M) V
MinValue retrieves mininum value of map
func MinmaxKey ¶
func MinmaxKey[M ~map[K]V, K constraints.Ordered, V any](m M) (min, max K)
MinmaxKey retrieves mininum and maxinum key of map
func MinmaxValue ¶
func MinmaxValue[M ~map[K]V, K comparable, V constraints.Ordered](m M) (min, max V)
MinmaxValue retrieves mininum and maxinum value of map
func SumFunc ¶
func SumFunc[ M ~map[K]V, F ~func(K, V) T, K comparable, V any, T constraints.Number | ~string, ](m M, f F) T
SumFunc sums mapped values by function f
func SumKey ¶
func SumKey[ M ~map[K]V, K constraints.Number | ~string, V any, ](m M) K
SumKey sums keys of map
func SumValue ¶
func SumValue[ M ~map[K]V, K comparable, V constraints.Number | ~string, ](m M) V
SumValue sums values of map
Types ¶
This section is empty.