• Ryan Scott's avatar
    Encode strictness in GHC generics metadata · ee6fba89
    Ryan Scott authored
    This augments `MetaSel` with a `Bang` field, which gives generic
    programmers access to the following information about each field
    * `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
To find the state of this project's repository at the time of any of these versions, check out the tags..
changelog.md 16.1 KB