Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Would be nice to have OrderedMap and OrderedSet be indexed #1893

Copy link
Copy link
Open
@tolmasky

Description

@tolmasky
Issue body actions

Order matters for these two collection types, and the collection clearly knows the indexing internally in the _list member (I know, implementation detail, but it would have to know somehow either way), so it is very unfortunate that you can't really treat interface with the indexes in many meaningful ways. To list two instances that I frequently run into this problem:

  1. Would of course be nice to just be able to do orderedMap.at(index). This is my main gripe right now, the fact that I need to store out an almost identical separate collection that's just a List to be able to go to index -> item.

  2. Would be nice to have index show up in things like map and reduce (filter, etc.). Given that the API for .map is already (item, key, collection), perhaps we could do (item, key, collection, index) to not have any backwards-incompatible changes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.