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

GHC ghc-devs at haskell.org
Wed Jun 17 10:25:25 UTC 2015


#7401: Can't derive instance for Eq when datatype has no constructor, while it is
trivial do do so.
-------------------------------------+-------------------------------------
        Reporter:  jpbernardy        |                   Owner:  osa1
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:  7.12.1
       Component:  Compiler          |                 Version:  7.6.1
      Resolution:                    |                Keywords:  deriving,
Operating System:  Unknown/Multiple  |  newcomer
 Type of failure:  GHC rejects       |            Architecture:
  valid program                      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:  Phab:D978
-------------------------------------+-------------------------------------

Comment (by simonpj):

 I'm losing the will to live on this one!

 > Please, consider forcing the arguments in all these instances, before
 failing.

 Not necessarily easy, if the argument is `[a]`, say rather than `a`.  This
 is so much a corner case that what osa1 has implemented seems fine to me.

 On (3) I suppose that either you can make the `TcDeriv` code check for
 `isEnumerationOrEmpty` (simplest), or fix the table-generation stuff.

 Simon

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


More information about the ghc-tickets mailing list