Skip to content

Strict maps as newtypes #1124

Open
Open
@meooow25

Description

@meooow25

Currently we have Lazy and Strict modules for Map and IntMap that act on the same type, which is a potential source of confusion and bugs.

An arguably better situation would be to have strict maps as newtypes over lazy maps. This will prevent maps from being used with the wrong module and allow strict maps to have their own instances. At the same time, it will remain possible to explicitly convert between the types in constant time.

However,

  • Do users want to use separate strict types? The strict-containers library exists today, but isn't widely used(?)
  • To avoid breakage, it would be best to have this newtype in a separate module. Having two strict modules would be confusing, how do we address that?
  • If we were to consider a breaking change and change the Strict module to work on a newtype, what amount of breakage would we see?

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