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

Simplify mkWeakIORefValue #154

Merged
merged 1 commit into from May 2, 2021
Merged

Simplify mkWeakIORefValue #154

merged 1 commit into from May 2, 2021

Conversation

DevJac
Copy link
Contributor

@DevJac DevJac commented Aug 28, 2017

This is equivalent to the old code, but without the need to check the version of base.

This change was inspired by looking at the source code for System.Mem.Weak.mkWeak in base.

I will not be offended if you reject this PR. I recognize that there is always risk when changing code, and since this code does the same thing as before, it may not be worth merging.

I have tested this code on GHC 7.8, 7.10, and 8.0. The tests pass on each of those three versions.

This is equivalent to the old code, but without the need to check the version of base.

This change was inspired by looking at the source code for System.Mem.Weak.mkWeak in base.
@mitchellwrosen
Copy link
Collaborator

LGTM, thanks. I suppose the original code may have had an eye towards eventually attaching finalizers to some refs, but in the meantime this does clean some things up.

@mitchellwrosen mitchellwrosen merged commit 3003964 into HeinrichApfelmus:master May 2, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants