[GHC] #9575: -XAutoDeriveTypeable fails to generate instances

GHC ghc-devs at haskell.org
Thu Sep 11 21:09:36 UTC 2014


#9575: -XAutoDeriveTypeable fails to generate instances
-------------------------------------+-------------------------------------
              Reporter:  hvr         |            Owner:  dreixel
                  Type:  bug         |           Status:  new
              Priority:  high        |        Milestone:  7.8.4
             Component:  Compiler    |          Version:  7.8.3
            Resolution:              |         Keywords:
      Operating System:              |     Architecture:  Unknown/Multiple
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:              |       Blocked By:
  None/Unknown                       |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by hvr):

 Replying to [comment:2 rwbarton]:
 > See ticket:8950#comment:3.
 >
 > I don't see what there is to gain by backporting a fix though, even if
 you could detect GHC 7.8.4, it's still more effort to do so than to just
 add `Typeable` to the deriving list. And it could break old code that uses
 `AutoDeriveTypeable`, by causing it to export more instances than it did
 under 7.8.3.

 How would this break old code (unless orphan instances are involved) by
 exporting //more// instances?

 However, at the very least this should be documented (unless it's easy
 enough to fix) as a known-bug in 7.8.4's manual (should 7.8.4 be ever be
 released). Or GHC 7.8.4 could even warn when -XAutoDeriveTypeable is used
 to raise awareness, that it doesn't work as advertised in GHC 7.8, so
 people don't start using it next year with GHC 7.10 (where it works as
 intended), and then assume it worked in GHC 7.8 as well. Alas, missing
 instances like `Typeable` go easily undetected in libraries.


 And fwiw, you can discriminate GHC 7.8.4 quite easily via Cabal's `if
 impl(ghc>=7.8.4) ...` conditionals...

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


More information about the ghc-tickets mailing list