<div dir="ltr"><div></div><div><a href="https://github.com/ghc-proposals/ghc-proposals/pull/149" rel="noreferrer" target="_blank">https://github.com/ghc-<wbr>proposals/ghc-proposals/pull/<wbr>149</a></div><div><br></div><div>This proposal is essentially an optimisation to the atomicModifyMutVar# primitive. I won't repeat the details here, but it amounts to moving one of the thunks produced by atomicModifyMutVar# out of the primop and into the atomicModifyIORef wrapper. The advantage is that in the case of the strict version of the wrapper, atomicModifyIORef', this extra thunk is eliminated entirely, rather than being created by the primop and then immediately evaluated by the wrapper.<br></div><div><br></div><div>I propose we accept the proposal to add the new primop in section 2.1, along with the straightforward additions proposed in sections 2.2 and 2.3. (the old primop will be removed, but can be defined in GHC.Exts  as a wrapper around the new primop for backwards compat)<br></div><div><br></div><div>However, the additions to the Data.IORef library should be considered by the libraries committee separately. (there are naming issues to be resolved in particular).</div><div><br></div><div>Cheers</div><div>Simon<br></div></div>