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

Why all the MVars? #10

Open
treeowl opened this issue Sep 7, 2018 · 2 comments
Open

Why all the MVars? #10

treeowl opened this issue Sep 7, 2018 · 2 comments

Comments

@treeowl
Copy link
Contributor

treeowl commented Sep 7, 2018

It's not at all obvious to me why we need MVars here. Why not just use StateT to handle the state of the computation? Is there some way for mapDeRef to exploit this through concurrency or lazy IO? If so, that should be documented. If not, let's simplify them away.

@treeowl
Copy link
Contributor Author

treeowl commented Sep 7, 2018

Even if we really do need concurrency variables here for some reason, we can at least generate the uniques in a more performant way. Atomically reading and incrementing a counter should be cheaper than mucking about with an MVar.

@andygill
Copy link
Member

andygill commented Sep 9, 2018

This is code written 10 years ago. I can't remember. However, if it can be rewritten using StateT, then all power to you. I'm happy reviewing changes, and there are already tests that can be used.

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

2 participants