[GHC] #7401: Can't derive instance for Eq when datatype has no constructor, while it is trivial do do so.

GHC cvs-ghc at haskell.org
Fri Apr 12 20:23:04 CEST 2013


#7401: Can't derive instance for Eq when datatype has no constructor, while it is
trivial do do so.
---------------------------------+------------------------------------------
    Reporter:  jpbernardy        |       Owner:                           
        Type:  feature request   |      Status:  new                      
    Priority:  normal            |   Milestone:                           
   Component:  Compiler          |     Version:  7.6.1                    
    Keywords:  deriving          |          Os:  Unknown/Multiple         
Architecture:  Unknown/Multiple  |     Failure:  GHC rejects valid program
  Difficulty:  Unknown           |    Testcase:                           
   Blockedby:                    |    Blocking:                           
     Related:                    |  
---------------------------------+------------------------------------------
Changes (by igloo):

  * difficulty:  => Unknown


Old description:

> On a "phantom datatype" D, one gets the message:
>
> Can't make a derived instance of `Eq D':
>       `D' must have at least one data constructor
>
> However there is a trivial, correct instance of Eq D:
>
> instance Eq D where
>   (==) = undefined

New description:

 On a "phantom datatype" D, one gets the message:
 {{{
 Can't make a derived instance of `Eq D':
       `D' must have at least one data constructor
 }}}
 However there is a trivial, correct instance of Eq D:
 {{{
 instance Eq D where
   (==) = undefined
 }}}

--

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



More information about the ghc-tickets mailing list