[GHC] #11120: Missing type representations

GHC ghc-devs at haskell.org
Fri Jan 15 15:27:36 UTC 2016


#11120: Missing type representations
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                Owner:
            Type:  bug               |               Status:  patch
        Priority:  high              |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  7.11
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D1769
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 So I have a very rough cut of Richard's proposal. The primary wrinkle that
 I ran into here is that you are forced to produce the `GHC.Prim`
 representations as `CoreExpr`s in order to wire them in (as wired-in
 identifiers are just identifiers without a definition but instead a
 compulsory unfolding, which is Core). This is a bit unfortunate as in the
 usual case we produce representations as standard `HsExpr`s, meaning we
 must duplicate the code for producing type representations.

 There are three options I can see here,

  1. Accept the code duplication and move on with life

  2. Use compulsory unfoldings for all type representations, allowing us to
 drop the current `HsExpr` logic in `TcTypeable`

  3. Instead make the `GHC.Prim` representations merely known-key and
 inject the bindings into some other module (like `GHC.Types`, since
 `GHC.Prim` doesn't have associated object code). This means we'd keep some
 of the special-case that we currently have, but on the other hand we could
 drop the hand-written type representations.

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


More information about the ghc-tickets mailing list