Encode strictness in GHC generics metadata

Authored by RyanGlScott on Dec 21 2015, 9:11 AM.

Description

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 Trac #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: Trac #10716

Details

Committed
bgamariDec 21 2015, 12:09 PM
Pushed
bgamariAug 25 2016, 1:39 PM
Reviewer
bgamari
Differential Revision
D1646: Encode strictness in GHC generics metadata
Parents
rGHCDIFF99b956ef1d4b: Fix-up GHC 7.12 artifacts
Branches
Unknown
Tags
Unknown