[GHC] #9948: Recommend class constraint instead of instance constraint

GHC ghc-devs at haskell.org
Tue Jan 6 12:21:15 UTC 2015


#9948: Recommend class constraint instead of instance constraint
-------------------------------------+-------------------------------------
        Reporter:  crockeea          |                   Owner:
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.8.4
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by adamgundry):

 I think the message ought to keep saying `No instance for (Num a)` because
 that is exactly what is logically missing, as Richard says. There is an
 instance for `Foo a`, and it would be very confusing if GHC claimed there
 wasn't. I'd be open to the `Possible fix` line saying `(Num a) or (Foo
 a)`, but I suspect the work required to change it may outweigh the
 benefit.

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


More information about the ghc-tickets mailing list