[GHC] #11796: Warn about unwanted instances in a modular way

GHC ghc-devs at haskell.org
Mon May 23 19:26:08 UTC 2016


#11796: Warn about unwanted instances in a modular way
-------------------------------------+-------------------------------------
        Reporter:  Lemming           |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #11219            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Lemming):

 Replying to [comment:5 RyanGlScott]:
 > Replying to [comment:4 Lemming]:
 > > A unification with the WARNING pragma looks like a good idea to me. I
 think I did not consider it, because currently warnings cannot be grouped.
 But if WARNINGs can be grouped we could re-use this capability for
 `instance` warnings.
 >
 > `WARNING`s can be grouped, actually:
 >
 > {{{#!hs
 > hello = "hello"
 > world = "world"
 >
 > {-# WARNING hello, world "Beware" #-}
 > }}}

 I see, the grouping works the other way round to what I had in mind. See
 below.

 > Indeed. In fact, there could be two different private modules in the
 same package that export two functions with the same name, or two
 instances with the same tag. I can't think of a better way to tell them
 apart, can you?

 I would consider it a feature, not a bug. Every warning tag should
 represent a group not a single object. If  multiple objects get the same
 tag, you can enable and disable and error-convert multiple warnings via
 one tag.

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


More information about the ghc-tickets mailing list