Description
Currently, unordered-containers
has a Data.HashMap.Array
module that's pretty similar to Data.Primitive.SmallArray
. I'd love to stack unordered-containers
on top of primitive
to avoid this duplication. Aside from the bugs currently being fixed in primitive
, I'm missing some operations. Notably, I need operations like strict map
(map over an array, forcing the results) and strict traverse
(traverse an array, forcing the results as they're installed). Could we add such operations?
Furthermore, some strictness bugs that have turned up in unordered-containers
were caused by failure to force things before installing them in arrays. One possible fix would be to add modules full of strict array operations (the way we have Data.HashMap.Lazy
and Data.HashMap.Strict
with the same types). Another option would be to offer a separate type for notionally strict arrays, offering only strict operations (and no Functor
instance). This would make it easy to avoid goofing up, but users could break open the abstraction if necessary to implement things like efficient Functor
and Traversable
instances for types using "strict" arrays.