Skip to content

Add strict array operations and perhaps arrays #98

Open
@treeowl

Description

@treeowl

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.

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