Skip to content
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

review HashSet #2

Open
infinity0 opened this issue Apr 13, 2021 · 0 comments
Open

review HashSet #2

infinity0 opened this issue Apr 13, 2021 · 0 comments

Comments

@infinity0
Copy link
Member

containers' Set is defined as a separate data type where every field is strict so it is obvious there is no value to defining a "more strict" one here, since it would be exactly the same.

OTOH, unordered-containers' HashSet is defined as a newtype wrapper around HashMap _ (). Because HashMap internally uses a primitive Array# which is lazy in its contents, this means that HashSet may contain thunks even when the values are all (). This could be what's behind haskell-unordered-containers/unordered-containers#70.

If we instead define HashSet from our stricter HashMap, whose array operations all force the value, then we can avoid this potential problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant