[GHC] #11011: Add type-indexed type representations (`TypeRep a`)

GHC ghc-devs at haskell.org
Mon Feb 1 14:16:01 UTC 2016


#11011: Add type-indexed type representations (`TypeRep a`)
-------------------------------------+-------------------------------------
        Reporter:  bjmprice          |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:
      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):

 Replying to [comment:13 simonpj]:
 > * The entire business of "querying the kinds at which a `TyCon` is
 instantiated" seems moot once types and kinds are unified.  I.e. now.
 Doesn't the same decompose-type-application stuff work for kinds?

 No. We're using "kind" here to refer to parameters in which the tycon's
 kind is dependent. That is, when we have `Proxy :: forall k. k -> Type`,
 `Proxy`'s first argument is dependent. We can't have a `TypeRep` just for
 plain, uninstantiated `Proxy` because `Proxy`'s kind mentions a forall,
 and we would need `TypeRep (forall k. k -> Type) Proxy`, which requires
 impredicativity. And there's the matter of writing the very intricate type
 for `mkAppTy :: TypeRep ... -> TypeRep ... -> TypeRep ...`, which would
 now need to perform substitution. Ick. So we just don't do any of it.

 This means that we can't decompose kind parameters.

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


More information about the ghc-tickets mailing list