Skip to content

Reconsider NominalElementDictionary #122

@dabrahams

Description

@dabrahams

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.

/cc @saeta @marcrasi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions