[GHC] #13841: ADOPT pragma for silencing orphan instances warnings per instance

GHC ghc-devs at haskell.org
Mon Jun 19 15:21:03 UTC 2017


#13841: ADOPT pragma for silencing orphan instances warnings per instance
-------------------------------------+-------------------------------------
        Reporter:  cocreature        |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #602, #10150      |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * related:   => #602, #10150


Comment:

 (See also #10150, which is essentially the same thing as this ticket.)

 Let me offer a dissenting opinion. I don't think we should be introducing
 tailor-made pragmas to suppress certain warnings like this. If we are in
 the business of suppressing warnings, we really should have a general
 mechanism that could work for //any// warning by delimiting regions of
 code that should have the warning disabled (the subject of #602). IMO,
 anything less than this is asking for trouble down the road.

 Moreover, I'm not a fan of changing the syntax of instances themselves
 just for the purposes of warning generation. We already have at least one
 pragma you can put in the same position, so now this would lead to pragma
 noise like:

 {{{#!hs
 instance {-# OVERLAPPING #-} {-# ADOPT #-} C T
 }}}

 In addition, we'd have to update the GHC and Template Haskell ASTs to
 support this, and I don't think what this buys us is worth the cost.

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


More information about the ghc-tickets mailing list