[commit: ghc] master: Encode strictness in GHC generics metadata (ee6fba8)
git at git.haskell.org
git at git.haskell.org
Mon Dec 21 18:09:11 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/ee6fba89b066fdf8408e6a18db343a4177e613f6/ghc
>---------------------------------------------------------------
commit ee6fba89b066fdf8408e6a18db343a4177e613f6
Author: RyanGlScott <ryan.gl.scott at gmail.com>
Date: Mon Dec 21 16:11:25 2015 +0100
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
>---------------------------------------------------------------
ee6fba89b066fdf8408e6a18db343a4177e613f6
compiler/prelude/PrelNames.hs | 48 +++-
compiler/prelude/TysWiredIn.hs | 8 +-
compiler/typecheck/TcGenGenerics.hs | 72 ++++--
docs/users_guide/7.12.1-notes.rst | 3 +
docs/users_guide/glasgow_exts.rst | 34 ++-
libraries/base/GHC/Generics.hs | 283 +++++++++++++++++----
libraries/base/changelog.md | 5 +
testsuite/tests/generics/GFullyStrict.hs | 57 +++++
.../GFullyStrict.stdout} | 0
testsuite/tests/generics/GenDerivOutput.stderr | 50 +++-
testsuite/tests/generics/GenDerivOutput1_0.stderr | 28 +-
testsuite/tests/generics/GenDerivOutput1_1.stderr | 200 ++++++++++-----
testsuite/tests/generics/all.T | 2 +
13 files changed, 618 insertions(+), 172 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ee6fba89b066fdf8408e6a18db343a4177e613f6
More information about the ghc-commits
mailing list