[GHC] #7148: generalized newtype and type families is unsound

GHC cvs-ghc at haskell.org
Wed Aug 15 05:39:33 CEST 2012


#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 <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list