Proposal: Improve the API for TChan, TMVar, and TVar

wren ng thornton wren at
Sat Apr 9 02:36:28 CEST 2011

On 3/26/11 5:29 AM, wren ng thornton wrote:
> I've found the following functions helpful for working with STM. Some of
> them are just filling out the API so that TVars, TMVars, and IORefs
> match better. And all the non-TVar functions can be optimized
> considerably by including them in the STM library rather than defining
> them externally. The implementations are obvious, so I'll just include
> the types here; see the patch if you're interested.
> [...]
> Discussion period: 2 weeks.

The discussion period is up, and it sounds like the patch is in. I've 
filed a ticket, with the following summary.

Supported by Edward Z. Yang, Bas van Dijk(*), Antoine Latter. No dissent.

Bas van Dijk's support is generally contingent on further improving the 
overall API by adding similar functions for the non-STM concurrency 
types. However, doing so requires a deprecation cycle in order to bring 
modifyMVar in sync with modifyTVar, modifyIORef, and the rest of the 
Haskell ecosystem. And therefore should be pursued in a separate 
proposal. He offered a patch,, which 
still requires verification of correctness. These changes to the base 
package are not included in the current proposal.

Live well,

More information about the Libraries mailing list