barrucadu / dejafu

Systematic concurrency testing meets Haskell.
https://dejafu.docs.barrucadu.co.uk/
191 stars 18 forks source link

Wrapping Data.Unique? #368

Open nomeata opened 2 years ago

nomeata commented 2 years ago

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?