[GHC] #10978: Anonymous type instances

GHC ghc-devs at haskell.org
Fri Oct 16 14:57:28 UTC 2015


#10978: Anonymous type instances
-------------------------------------+-------------------------------------
        Reporter:  benjamin.hodgson  |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  7.8.3
  checker)                           |
      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 goldfire):

 I don't see any structural problems with this proposal, but I think it
 doesn't pay its way. It would be yet another wrinkle to already-quite-
 complex type family story. And, I think more problematically, this
 approach would prohibit you to write class instances for these new
 datatypes. Because type families are not injective and generative, you
 cannot specify a type family in a class instance head. But with these
 "anonymous type instances", there would be no other way to name the
 datatype, so you've effectively made datatypes for which no instances can
 exist. (Except maybe by `deriving`. But you'd even be prohibited from
 standalone-deriving.)

 So I'm skeptical, even though I do think the underlying idea is sound. If
 you really want this, find a loud chorus of people who think likewise. :)

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


More information about the ghc-tickets mailing list