[GHC] #10343: Make Typeable track kind information better

GHC ghc-devs at haskell.org
Thu Apr 23 15:50:12 UTC 2015


#10343: Make Typeable track kind information better
-------------------------------------+-------------------------------------
        Reporter:  oerjan            |                   Owner:
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:  typeOf ::
 Related Tickets:  #9858             |  Typeable (a::k) => Proxy a ->
                                     |  TypeRep
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by oerjan):

 I knew I shouldn't have rambled on so much in my post... the mention of
 extracting `KindRep` was not a direct wish, more my explanation of why the
 current design ''doesn't'' handle my test cases. As in, it would be needed
 to implement a solution to them.

 So I guess a shorter summary of what I want is in order:

 I want that the type inference and runtime representation should support
 constructing `Typeable (T :: k)`, even when `k` contains kind variables
 that are only mentioned in other `Typeable` constraints ''not''
 necessarily involving the type constructor `T`.

 (This assumes that type application keeps working as well as it does. Type
 constructors are the base case which now sometimes doesn't work.)

 This is, as far as I can see, precisely what is needed to get things like
 `typeOf :: Typeable a => Proxy a -> TypeRep` or `typeRep :: Typeable a =>
 Proxy (Typeable a) -> TypeRep` to work, but it would also enable much more
 contrived things like my kitchen sink example.

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


More information about the ghc-tickets mailing list