// Group returns a new non-nil map containing the elements of s grouped by the // keys returned from the key func. func Group[K comparable, V any](s []V, key func(V) K) map[K][]V { … } // Keys returns the keys of the map M, like slices.Collect(maps.Keys(m)). func KeySlice[M ~map[K]V, K comparable, V any](m M) []K { … } // Values returns the values of the map M, like slices.Collect(maps.Values(m)). func ValueSlice[M ~map[K]V, K comparable, V any](m M) []V { … } // SameKeys reports whether x and y have equal sets of keys. func SameKeys[K comparable, V1, V2 any](x map[K]V1, y map[K]V2) bool { … } // Sorted returns an iterator over the entries of m in key order. func Sorted[M ~map[K]V, K cmp.Ordered, V any](m M) iter.Seq2[K, V] { … }