[GHC] #9214: UNPACK support for sum types

GHC ghc-devs at haskell.org
Wed Jun 18 10:52:18 UTC 2014


#9214: UNPACK support for sum types
------------------------------------+-------------------------------------
       Reporter:  mojojojo          |             Owner:
           Type:  feature request   |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  Compiler          |           Version:  7.8.2
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 Currently the pragma only supports single-constructor types. So in the
 following example it will simply be ignored:

 {{{
 data A =
   A1 Char |
   A2 {-# UNPACK #-} !B

 data B =
   B1 Int |
   B2 Bool
 }}}

 However the problem seems to be easily solvable by denormalizing the type
 {{{A}}} to something like the following during unpacking:

 {{{
 data A =
   A1 Char |
   A2_1 Int |    -- from B1
   A2_2 Bool     -- from B2
 }}}

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


More information about the ghc-tickets mailing list