[GHC] #11449: Treat '_' consistently in type declarations

GHC ghc-devs at haskell.org
Thu Jan 21 21:58:45 UTC 2016


#11449: Treat '_' consistently in type declarations
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       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 RyanGlScott):

 I'm a bit confused about example (C), since I don't think this:

 {{{#!hs
 class C [a] where
    type T [a] = Int
 }}}

 is legal (which is what example (C) is, just with `_` instead of `a`).

 Did you mean something like this?

 {{{#!hs
 class C _ where
   type T _ = Int
 }}}

 or this?

 {{{#!hs
 instance C [_] where
   type T [_] = Int
 }}}

 I can understand objecting to the former (similarly, you'd reject `data T
 _ = MkT _`, right?), but I certainly want the latter to be legal,
 especially if we require the class instance types to be the same as the
 associated type family types—otherwise, I'd have no way of
 [https://ghc.haskell.org/trac/ghc/ticket/11450#comment:16 wildcard-ing out
 unused types in such a scenario].

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


More information about the ghc-tickets mailing list