[GHC] #3888: Suggest -XGeneralizedNewtypeDeriving for newtypes

GHC trac at galois.com
Fri Feb 19 13:28:19 EST 2010


#3888: Suggest -XGeneralizedNewtypeDeriving for newtypes
---------------------------------+------------------------------------------
    Reporter:  guest             |       Owner:              
        Type:  bug               |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:  6.12.1            |    Keywords:              
          Os:  Unknown/Multiple  |    Testcase:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
 newtype A = A Int deriving Enum

 t.hs:1:27:
     Can't make a derived instance of `Enum A'
       (`A' has non-nullary constructors)
     In the newtype declaration for `A'

 But perhaps -XGeneralizedNewtypeDeriving should be suggested (ideally only
 if the wrapped type actually had such an instance)?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3888>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list