[GHC] #9210: "overlapping instances" through FunctionalDependencies

GHC ghc-devs at haskell.org
Tue Apr 18 16:20:28 UTC 2017


#9210: "overlapping instances" through FunctionalDependencies
-------------------------------------+-------------------------------------
        Reporter:  rwbarton          |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  7.8.2
  checker)                           |
      Resolution:                    |             Keywords:  FunDeps
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by diatchki):

 Here is a simplified version of the example in the ticket:
 {{{
 class Foo a b c | a b -> c

 instance Foo (x, a) x ((), a)
 instance Foo (x, a) a (x, ())
 }}}

 These two instances are accepted by GHC 8.0.1, but should be rejected as
 they violate the FD on the class. Here is the counter example:
 {{{
 Foo (Int,Int) Int ((), Int)
 Foo (Int,Int) Int (Int, ())
 }}}

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


More information about the ghc-tickets mailing list