Proposal: Improve the API for TChan, TMVar, and TVar
wren ng thornton
wren at freegeek.org
Sun Mar 27 06:04:35 CEST 2011
On 3/26/11 8:11 PM, Bas van Dijk wrote:
> On 26 March 2011 22:02, wren ng thornton<wren at freegeek.org> wrote:
>> Perhaps the solution at this stage would be to:
>> (1) add modifyMVarM :: MVar a -> (a -> IO (a,b)) -> IO b
>> (2) deprecate modifyMVar
>> (3) wait a cycle
>> (4) remove modifyMVar (if needed)
>> (5) wait a cycle (if needed)
>> (6) add modifyMVar :: MVar a -> (a -> a) -> IO ()
>> It'll take forever, but I think it's important to get the names right for
>> this kind of thing rather than letting the inconsistency linger. Of course,
>> this would best be done through a separate proposal IMO.
> I agree this should be done in a separate proposal. But while we're
> talking about it: what's the reason for the extra wait cycle in (5)?
> Can't we just replace (4),(5) and (6) with a single point where we
> undeprecate modifyMVar and change its type to the final: MVar a -> (a
> -> a) -> IO () ?
Because I don't recall the finer points of the deprecation protocol. I
added steps (4) and (5) just in case the protocol says they're needed.
I'd much rather drop them if that's allowed :)
More information about the Libraries