Skip to content

Strict maps as newtypes #1124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
meooow25 opened this issue Mar 21, 2025 · 0 comments
Open

Strict maps as newtypes #1124

meooow25 opened this issue Mar 21, 2025 · 0 comments

Comments

@meooow25
Copy link
Contributor

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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant