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

Test for internal strictness #235

Open
treeowl opened this issue May 7, 2019 · 1 comment
Open

Test for internal strictness #235

treeowl opened this issue May 7, 2019 · 1 comment

Comments

@treeowl
Copy link
Collaborator

treeowl commented May 7, 2019

#232 revealed that Data.HashMap.Strict.insert could produce a HashMap containing "stupid thunks" (i.e., ones guaranteed to compute successfully in O(1) time). @mantasg discovered this bug in the process of playing around with ghc-heap-view. Could we use ghc-heap-view (or borrow its techniques) to check for these problems? I believe we want to maintain the invariant that for any function in Data.HashMap.Strict, if none of the HashMap arguments to the function contains a thunk, then the result will not contain a thunk. In particular, a HashMap built solely using functions in Data.HashMap.Strict should never contain a thunk.

@sjakobi
Copy link
Member

sjakobi commented Mar 20, 2022

Maybe we can use nothunks for this.

I have recently discovered some space leaks and broken strictness properties (#379, #381, #382, #383) just by reading the code and generated Core. There may be more subtle issues lurking.

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

2 participants