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

GHC ghc-devs at haskell.org
Mon Jun 16 13:15:12 UTC 2014


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

 * version:  7.8.1 => 7.8.2


Comment:

 Oh, since I minimized the example now I can test more easily with other
 GHC versions.

 This is a regression from GHC 7.6.3, in that that version rejected `main`
 with the following error (that I don't really understand):
 {{{
 some.hs:22:23:
     Couldn't match type `Int' with `String'
     When using functional dependencies to combine
       Foo (a, x) (a, y) x y,
         arising from the dependency `a b s -> t'
         in the instance declaration at some.hs:19:10
       Foo (Int, Int) (String, Int) Int String,
         arising from a use of `foo' at some.hs:22:23-25
     In the first argument of `modify', namely `foo'
     In the second argument of `($)', namely
       `modify foo (show :: Int -> String) (1 :: Int, 2 :: Int)'
 Failed, modules loaded: none.
 }}}
 If I remove `main` then GHC 7.6.3 does accept the instances, though. That
 seems wrong to me also (though certainly "less wrong").

 I have a GHC 7.8.2.20140609 lying around and it displays the same behavior
 as GHC 7.8.1.

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


More information about the ghc-tickets mailing list