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 CopyFunc[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 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[D ~[]T, M ~map[K]V, F ~func(K, V) T, K comparable, V any, T any](m M, f F) D
- func MaxKey[M ~map[K]V, K constraints.Ordered, V any](m M) K
- func MaxKeyFunc[M ~map[K]V, F ~func(K, V) T, K comparable, V any, T constraints.Ordered](m M, f F) T
- func MaxValue[M ~map[K]V, K comparable, V constraints.Ordered](m M) pair.Pair[K, V]
- func MaxValueFunc[M ~map[K]V, F ~func(K, V) T, K comparable, V any, T constraints.Ordered](m M, f F) pair.Pair[K, T]
- func MinKey[M ~map[K]V, K constraints.Ordered, V any](m M) K
- func MinKeyFunc[M ~map[K]V, F ~func(K, V) T, K comparable, V any, T constraints.Ordered](m M, f F) T
- func MinValue[M ~map[K]V, K comparable, V constraints.Ordered](m M) pair.Pair[K, V]
- func MinValueFunc[M ~map[K]V, F ~func(K, V) T, K comparable, V any, T constraints.Ordered](m M, f F) pair.Pair[K, T]
- func MinmaxKey[M ~map[K]V, K constraints.Ordered, V any](m M) (min, max K)
- func MinmaxKeyFunc[M ~map[K]V, F ~func(K, V) T, K comparable, V any, T constraints.Ordered](m M, f F) (min, max T)
- func MinmaxValue[M ~map[K]V, K comparable, V constraints.Ordered](m M) (min, max pair.Pair[K, V])
- func MinmaxValueFunc[M ~map[K]V, F ~func(K, V) T, K comparable, V any, T constraints.Ordered](m M, f F) (min, max pair.Pair[K, T])
- 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 CopyFunc ¶ added in v0.2.19
func CopyFunc[ 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
CopyFunc inserts pairs mapping from key-value pair of m by function f
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[ D ~[]T, M ~map[K]V, F ~func(K, V) T, K comparable, V any, T any, ](m M, f F) D
Map creates a slice and inserts values 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 MaxKeyFunc ¶ added in v0.2.19
func MaxKeyFunc[ M ~map[K]V, F ~func(K, V) T, K comparable, V any, T constraints.Ordered, ](m M, f F) T
MaxKeyFunc retrieves maxinum key of map
func MaxValue ¶
func MaxValue[M ~map[K]V, K comparable, V constraints.Ordered](m M) pair.Pair[K, V]
MaxValue retrieves mininum value of map
func MaxValueFunc ¶ added in v0.2.19
func MaxValueFunc[ M ~map[K]V, F ~func(K, V) T, K comparable, V any, T constraints.Ordered, ](m M, f F) pair.Pair[K, T]
MaxValueFunc 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 MinKeyFunc ¶ added in v0.2.19
func MinKeyFunc[ M ~map[K]V, F ~func(K, V) T, K comparable, V any, T constraints.Ordered, ](m M, f F) T
MinKeyFunc retrieves mininum key of map
func MinValue ¶
func MinValue[M ~map[K]V, K comparable, V constraints.Ordered](m M) pair.Pair[K, V]
MinValue retrieves mininum value of map
func MinValueFunc ¶ added in v0.2.19
func MinValueFunc[ M ~map[K]V, F ~func(K, V) T, K comparable, V any, T constraints.Ordered, ](m M, f F) pair.Pair[K, T]
MinValueFunc 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 MinmaxKeyFunc ¶ added in v0.2.19
func MinmaxKeyFunc[ M ~map[K]V, F ~func(K, V) T, K comparable, V any, T constraints.Ordered, ](m M, f F) (min, max T)
MinmaxKeyFunc retrieves mininum and maxinum key of map
func MinmaxValue ¶
func MinmaxValue[M ~map[K]V, K comparable, V constraints.Ordered](m M) (min, max pair.Pair[K, V])
MinmaxValue retrieves mininum and maxinum value of map
func MinmaxValueFunc ¶ added in v0.2.19
func MinmaxValueFunc[ M ~map[K]V, F ~func(K, V) T, K comparable, V any, T constraints.Ordered, ](m M, f F) (min, max pair.Pair[K, T])
MinmaxValueFunc 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.