Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Deprecate and move StrMap? #118

Closed
Closed
@hdgarrood

Description

@hdgarrood

Continuing discussion from #116.

StrMap seems to only earn its place in this library if it can be treated as a general-purpose map data structure with string keys. However, it's difficult to justify this: asymptotically it's significantly worse than Map String for many operations, and the order that Foldable and Traversable instances iterate over entries is unpredictable (since it is based on a JS for-in loop underneath). Moreover, it's not at all clear how we might implement StrMap for other backends, since it has various JS quirks (not just the traversal order issue, but also things like keys with names like __proto__). StrMap clearly is useful for JS interop, though.

Given all this, I'd like to consider deprecating StrMap, and moving it to a different (new?) package. I'd suggest calling the package purescript-js-objects and renaming the StrMap type to JSObject; I think that's a better reflection of what its intended use is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions