Turn SampleVar into an abstract newtype
a Control.Concurrent.SampleVar
is currently a type synonym:
type SampleVar a = MVar (Int, MVar a)
This has two problems:
- Users can "screw up" the internal state.
- We can't define instances for
SampleVars
without using the
TypeSynonymInstances
language extension.
My proposal is to turn SampleVar
into an abstract newtype like:
newtype SampleVar a = SampleVar (MVar (Int, MVar a))
The related discussion on libraries@haskell.org
contains the patch that implements this:
http://thread.gmane.org/gmane.comp.lang.haskell.libraries/12626
Trac metadata
Trac field | Value |
---|---|
Version | 6.12.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | libraries/base |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |