[GHC] #11450: Associated types at wrong type in instance
GHC
ghc-devs at haskell.org
Fri Jan 22 14:56:24 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: #11449, #11451 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by RyanGlScott):
Replying to [comment:17 goldfire]:
> Re comment:16: But your two wildcards are referring to the same type. I
think we should require a name here, because the name is actually used
twice.
I suppose if we take interpret every occurrence of `_` as a fresh type
variable, then the `Either a _` in the instance head cannot be the same as
the one in the associated type family instance.
And there's even another reason to require named type variables: what
about `-XInstanceSigs`? If you allowed wildcards in instances, you could
have a scenario like this:
{{{#!hs
class C a where
c :: a -> String
instance C (Maybe _) where
c :: Maybe _ -> String
c _ = "huh?"
}}}
And we certainly don't allow wildcards in term-level type signatures like
this.
In light of this, I retract my objection in comment:16. As Simon said, the
description of the ticket is still right.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11450#comment:18>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list