You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I have been working on InsertionOrderedDictionary, I've started to wonder whether NominalElementDictionary was such a hot idea. Instead, maybe the thing to do is make an extension on Dictionary called nominalElements that presents the (key: Key, value: Value) elements as a Collection of KeyValuePair<Key, Value>. When people need the capabilities associated with a collection of KeyValuePair, they can use this extension. Otherwise it just sits there.
Part of the reason for this is that you lose convenient destructuring that was available with tuples. Part is the massive complexity overhead of making the whole dictionary API just in order to be able to use Collection where Element: SomeProtocol extensions.
As I have been working on
InsertionOrderedDictionary
, I've started to wonder whetherNominalElementDictionary
was such a hot idea. Instead, maybe the thing to do is make an extension onDictionary
callednominalElements
that presents the(key: Key, value: Value)
elements as aCollection
ofKeyValuePair<Key, Value>
. When people need the capabilities associated with a collection ofKeyValuePair
, they can use this extension. Otherwise it just sits there.Part of the reason for this is that you lose convenient destructuring that was available with tuples. Part is the massive complexity overhead of making the whole dictionary API just in order to be able to use
Collection where Element: SomeProtocol
extensions./cc @saeta @marcrasi
The text was updated successfully, but these errors were encountered: