[GHC] #10598: DeriveAnyClass and GND don't work well together

GHC ghc-devs at haskell.org
Mon May 30 23:48:41 UTC 2016


#10598: DeriveAnyClass and GND don't work well together
-------------------------------------+-------------------------------------
        Reporter:  osa1              |                Owner:  RyanGlScott
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  7.11
      Resolution:                    |             Keywords:  Generics
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D2280
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by oerjan):

 This may be off topic, but: Before the whole `OVERLAPPABLE` etc. stuff got
 included, I had somehow got the impression that pragmas were supposed to
 follow two simple principles, that improved portability between different
 compilers:

 * If a compiler does not understand a pragma other than a `LANGUAGE`
 pragma, it can safely ignore it, and if the program still compiles, its
 semantics must be the same.
 * If a compiler does not understand a `LANGUAGE` pragma, it should bail
 out with an error.

 The Haskell 2010 report seems to recommend this behavior, although it
 doesn't quite seem to require it.

 At some point things started to look inconsistent, so in a vain attempt to
 keep making sense of it I thought of an additional principle for added
 flexibility:

 * A `LANGUAGE` pragma might imply the existence of other pragmas, which
 must then also be understood.

 However, the `OVERLAPPABLE` etc. pragmas aren't as far as I know governed
 by any particular `LANGUAGE` pragma. Perhaps they still follow the first
 principle, I suspect there may be corner cases.

 Notably, I think the current Phab:D2280 implementation ''does'' obey the
 last principle. Any use of `DAC` or `GND` requires a corresponding
 language pragma, and `Builtin` never changes semantics.

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


More information about the ghc-tickets mailing list