[Pitch] - Add `DictionaryProtocol` to the standard library

Hey Ben!

It's not only sugar for the initializers. I proposed a modification to @lorentey's idea:

The current initializer (e.g. Dictionary.init(grouping:by:)) strongly couples instance creation and grouping, so it's impossible to do just the grouping on its own into an existing instance (without making a new dictionary and merging it into the old).

The only way to take an instance as a parameter would be if there was some protocol that describes a mutable associative collection.

1 Like