[GHC] #11450: Associated types at wrong type in instance
GHC
ghc-devs at haskell.org
Thu Jan 21 15:32:32 UTC 2016
#11450: Associated types at wrong type in instance
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner:
Type: bug | Status: new
Priority: high | Milestone: 8.0.1
Component: Compiler | Version: 7.10.3
Resolution: | Keywords:
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 simonpj):
It's simple. Consider
{{{
class C v where
type T a b v cd
}}}
In any instance declaration, the type in the `v` position of the `type`
instance must be the same as in the instance header:
{{{
instance ... => C ty where
type T p q ty r s = <rhs>
}}}
I think we do (or at least should) also insist that `p`, `q`, `r`, `s` are
distinct type variables, otherwise the type instance is more specific than
the class instance, but that's a separate matter.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11450#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list