[GHC] #10604: Make Generic1 kind polymorphic

GHC ghc-devs at haskell.org
Wed Jul 8 19:33:25 UTC 2015


#10604: Make Generic1 kind polymorphic
-------------------------------------+-------------------------------------
        Reporter:  DerekElkins       |                   Owner:  ekmett
            Type:  feature request   |                  Status:  new
        Priority:  low               |               Milestone:
       Component:  Core Libraries    |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by DerekElkins):

 Replying to [comment:2 dreixel]:
 > Do you have any particular use for this?

 I was making a data type parameterized by a data kind because it was built
 over another data type parameterized by a data kind.  This blocked being
 able to use GHC Generics with the type.  In this case, since I controlled
 the other data type, I just switched it to using empty data types of kind
 * rather than a data kind, so I'm not blocked by this.  If that other data
 type had been from a library or if data kinds were critical, this wouldn't
 have been an option.

 The Tree type here
 https://github.com/derekelkins/ads/blob/master/Data/Authenticated/GenericExample.hs
 was where I ran into the problem when the Auth type was parameterized by a
 data kind.  You can see here,
 https://github.com/derekelkins/ads/blob/master/Data/Authenticated/Generic.hs,
 that the Par1 constructor doesn't make sense in my context.  In fact, with
 DataKinds I would not need that comment, because it would simply be
 illegal to make a type that used Par1.  It would be a self-evident kind
 error rather than a less obvious missing instance error.

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


More information about the ghc-tickets mailing list