[GHC] #10716: Metadata in GHC.Generic should give access to strictness annotation

GHC ghc-devs at haskell.org
Mon Dec 21 18:09:06 UTC 2015


#10716: Metadata in GHC.Generic should give access to strictness annotation
-------------------------------------+-------------------------------------
        Reporter:  StefanWehr        |                Owner:
            Type:  feature request   |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.2
      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:1646
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"ee6fba89b066fdf8408e6a18db343a4177e613f6/ghc"
 ee6fba89/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="ee6fba89b066fdf8408e6a18db343a4177e613f6"
 Encode strictness in GHC generics metadata

 This augments `MetaSel` with a `Bang` field, which gives generic
 programmers access to the following information about each field
 selector:

 * `SourceUnpackedness`: whether a field was marked `{-# NOUNPACK #-}`,
   `{-# UNPACK #-}`, or not
 * `SourceStrictness`: whether a field was given a strictness (`!`) or
   laziness (`~`) annotation
 * `DecidedStrictness`: what strictness GHC infers for a field during
   compilation, which may be influenced by optimization levels,
   `-XStrictData`, `-funbox-strict-fields`, etc.

 Unlike in Phab:D1603, generics does not grant a programmer the ability
 to "splice" in metadata, so there is no issue including
 `DecidedStrictness` with `Bang` (whereas in Template Haskell, it had to
 be split off).

 One consequence of this is that `MetaNoSel` had to be removed, since it
 became redundant. The `NoSelector` empty data type was also removed for
 similar reasons.

 Fixes #10716.

 Test Plan: ./validate

 Reviewers: dreixel, goldfire, kosmikus, austin, hvr, bgamari

 Reviewed By: bgamari

 Subscribers: thomie

 Differential Revision: https://phabricator.haskell.org/D1646

 GHC Trac Issues: #10716
 }}}

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


More information about the ghc-tickets mailing list