GHC | 15 Aug 2012 05:39
Favicon

#7148: generalized newtype and type families is unsound

#7148: generalized newtype and  type families is unsound
------------------------------+---------------------------------------------
 Reporter:  carter            |          Owner:                  
     Type:  bug               |         Status:  new             
 Priority:  normal            |      Component:  Compiler        
  Version:  7.6.1-rc1         |       Keywords:                  
       Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
  Failure:  None/Unknown      |       Testcase:                  
Blockedby:                    |       Blocking:                  
  Related:                    |  
------------------------------+---------------------------------------------
 the code from
 http://joyoftypes.blogspot.com/2012/08/generalizednewtypederiving-is.html
 type checks in the release candidate

 also see discussion here
 http://www.reddit.com/r/haskell/comments/y8kca/generalizednewtypederiving_is_very_very_unsafe/

 (punch line: the generalized newtype deriving + type families or gadts
 allows users to write unsafeCoerce etc)

 perhaps a simple near term solution is to have any module using
 generalized new type deriving be inferred to be unsafe by default?

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7148>
GHC | 15 Aug 2012 05:43
Favicon

Re: #7148: generalized newtype and type families is unsound

#7148: generalized newtype and  type families is unsound
------------------------------+---------------------------------------------
 Reporter:  carter            |          Owner:                  
     Type:  bug               |         Status:  new             
 Priority:  normal            |      Component:  Compiler        
  Version:  7.6.1-rc1         |       Keywords:                  
       Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
  Failure:  None/Unknown      |       Testcase:                  
Blockedby:                    |       Blocking:                  
  Related:                    |  
------------------------------+---------------------------------------------

Comment(by carter):

 to clarify: tested code in ghci

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7148#comment:1>
GHC | 15 Aug 2012 13:41
Favicon

Re: #7148: generalized newtype and type families is unsound

#7148: generalized newtype and  type families is unsound
---------------------------------+------------------------------------------
    Reporter:  carter            |       Owner:                  
        Type:  bug               |      Status:  new             
    Priority:  normal            |   Milestone:                  
   Component:  Compiler          |     Version:  7.6.1-rc1       
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------
Changes (by simonpj):

  * difficulty:  => Unknown

Comment:

 See #1496.

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7148#comment:2>
GHC | 11 Sep 2012 23:48
Favicon

Re: #7148: generalized newtype and type families is unsound

#7148: generalized newtype and  type families is unsound
---------------------------------+------------------------------------------
    Reporter:  carter            |       Owner:                  
        Type:  bug               |      Status:  new             
    Priority:  normal            |   Milestone:                  
   Component:  Compiler          |     Version:  7.6.1-rc1       
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by dterei):

 GND isn't allowed in Safe modules, so yes it already causes code using it
 to be inferred Unsafe.

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7148#comment:3>
GHC | 17 Oct 2012 00:32
Favicon

Re: #7148: generalized newtype and type families is unsound

#7148: generalized newtype and  type families is unsound
----------------------------------------+-----------------------------------
    Reporter:  carter                   |       Owner:  simonpj         
        Type:  bug                      |      Status:  new             
    Priority:  normal                   |   Milestone:  7.8.1           
   Component:  Compiler (Type checker)  |     Version:  7.6.1-rc1       
    Keywords:                           |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple         |     Failure:  None/Unknown    
  Difficulty:  Unknown                  |    Testcase:                  
   Blockedby:                           |    Blocking:                  
     Related:                           |  
----------------------------------------+-----------------------------------
Changes (by igloo):

  * owner:  => simonpj
  * component:  Compiler => Compiler (Type checker)
  * milestone:  => 7.8.1

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7148#comment:4>

Gmane