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

GHC ghc-devs at haskell.org
Fri May 1 17:03:52 UTC 2015


#10343: Make Typeable track kind information better
-------------------------------------+-------------------------------------
        Reporter:  oerjan            |                   Owner:  goldfire
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:  7.12.1
       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):

 Replying to [comment:17 goldfire]:
 > I've updated [wiki:Typeable]. See the new Proposed API section, and the
 new Step 3.

 I'd like to note that if the proposed API is to help with Step 3 aka this
 ticket, either `trCon` or your suggested `tyConRep` needs to take a
 `TTypeRep k` argument.

 The "How can we get a TTyCon for a known-at-compile-time tycon?" was
 something I also stumbled on when trying to think of an API.  Curiously if
 you simplify this a bit by removing `TTyCon` (`>_> <_<`), there is a nice
 ''end-user'' way of writing this from what's on the wiki page:

 {{{
 x :: TTypeRep k -> TTypeRep (Proxy :: k -> *)
 x tt = withTypeable tt tTypeRep
 }}}

 Of course this just calls back into the entire machinery that's being
 implemented, so cannot be used as a basis.  However, it means that the
 primitive desugaring of this may not need to be exposed to users.

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


More information about the ghc-tickets mailing list