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

GHC ghc-devs at haskell.org
Sun Mar 19 17:01:38 UTC 2017


#11796: Warn about unwanted instances in a modular way
-------------------------------------+-------------------------------------
        Reporter:  Lemming           |                Owner:  (none)
            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 bergmark):

 Another notorious instance is `Show (a -> b)` from
 `base:Text.Show.Functions`. I ran across a bug where this instance was
 used by mistake because one of my libraries used it thus propagating the
 instance down to me. My solution was to remove this import from the
 offending library and also adding an `Unsatisfiable => Show (a -> b)`
 instance locally to prevent it from being used in the future. The latter
 does course not scale and shouldn't be used in libraries.

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


More information about the ghc-tickets mailing list