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

Wrapping Data.Unique? #368

Open
nomeata opened this issue Sep 12, 2022 · 0 comments
Open

Wrapping Data.Unique? #368

nomeata opened this issue Sep 12, 2022 · 0 comments

Comments

@nomeata
Copy link

nomeata commented Sep 12, 2022

In the code I need to test I need a source for unique comparable ids (to determine thread priorities; due to reentrancy, ThreadId is not quite good enough, I fear).

In the production code (normal IO), I can use newUnique. When testing, it seems I have to wrap it it in liftIO. This works, but is not optimal, as ideally I’d like dejafu to explore all possible priority orderings of the threads (as it does, I believe, for threadid?).

Could there be a MonadUnique abstracting over newUnique that explores that?

nomeata added a commit to nomeata/haskell-rec-def that referenced this issue Sep 12, 2022
I couldn’t quite break the previous code, but trying hard enogh it
should be possible, due to reentranc. So this seems safer.

Testing with dejafu suffers a bit, see barrucadu/dejafu#368
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