[GHC] #3928: Turn SampleVar into an abstract newtype
GHC
trac at galois.com
Fri Mar 19 06:48:17 EDT 2010
#3928: Turn SampleVar into an abstract newtype
---------------------------------+------------------------------------------
Reporter: basvandijk | Owner:
Type: proposal | Status: new
Priority: normal | Component: libraries/base
Version: 6.12.1 | Keywords:
Os: Unknown/Multiple | Testcase:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
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 at haskell.org}}} contains the patch
that implements this:
http://thread.gmane.org/gmane.comp.lang.haskell.libraries/12626
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3928>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list