Deprecate and move StrMap? #118
Description
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.