#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 {{{[email protected]}}} 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
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to