Proposal: replace readMVar with atomicReadMVar, breaking BC

Bertram Felgenhauer bertram.felgenhauer at
Wed Jul 10 19:21:28 CEST 2013

Edward Z. Yang wrote:
> GHC HEAD recently got a new primitive: atomicReadMVar#, which allows you
> to read MVars without first taking and then putting back

Great, thanks a lot!

> The general feeling Simon and I have is that everyone really wanted
> to make believe readMVar was atomicReadMVar, and so maybe we should
> break BC and make readMVar do the right thing.

I agree completely. In my experience, the current non-atomic behaviour
of readMVar has only lead to confusion; I don't see any use for this
behaviour. Besides, if anybody really wants that behaviour they should
probably invoke takeMVar and putMVar separately and add a comment or

I also agree with the reasoning behind processing atomicReadMVar

Best regards,


More information about the Libraries mailing list