[commit: ghc] master: Make dataToQa aware of Data instances which use functions to implement toConstr (d2f9972)

git at git.haskell.org git at git.haskell.org
Tue Oct 13 05:46:52 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/d2f9972a35ce05ceb8a78893e433ef1df06f73ef/ghc

>---------------------------------------------------------------

commit d2f9972a35ce05ceb8a78893e433ef1df06f73ef
Author: RyanGlScott <ryan.gl.scott at gmail.com>
Date:   Tue Oct 13 00:43:32 2015 -0500

    Make dataToQa aware of Data instances which use functions to implement toConstr
    
    Trac #10796 exposes a way to make `template-haskell`'s `dataToQa` function
    freak out if using a `Data` instance that produces a `Constr` (by means of
    `toConstr`) using a function name instead of a data constructor name. While
    such `Data` instances are somewhat questionable, they are nevertheless present
    in popular libraries (e.g., `containers`), so we can at least make `dataToQa`
    aware of their existence.
    
    In order to properly distinguish strings which represent variables (as opposed
    to data constructors), it was necessary to move functionality from `Lexeme` (in
    `ghc`) to `GHC.Lexeme` in a new `ghc-boot` library (which was previously named
    `bin-package-db`).
    
    Reviewed By: goldfire, thomie
    
    Differential Revision: https://phabricator.haskell.org/D1313
    
    GHC Trac Issues: #10796


>---------------------------------------------------------------

d2f9972a35ce05ceb8a78893e433ef1df06f73ef
 .gitignore                                         |  4 +-
 compiler/basicTypes/Lexeme.hs                      | 18 +-----
 compiler/ghc.cabal.in                              |  2 +-
 compiler/main/PackageConfig.hs                     |  2 +-
 docs/users_guide/7.12.1-notes.rst                  | 23 ++++++--
 ghc.mk                                             |  8 +--
 libraries/ghc-boot/GHC/Lexeme.hs                   | 32 ++++++++++
 .../{bin-package-db => ghc-boot}/GHC/PackageDb.hs  |  0
 libraries/{bin-package-db => ghc-boot}/LICENSE     |  0
 .../ghc-boot.cabal}                                | 21 +++----
 libraries/template-haskell/Language/Haskell/TH.hs  |  1 +
 .../template-haskell/Language/Haskell/TH/Syntax.hs | 69 ++++++++++++++++++----
 libraries/template-haskell/changelog.md            |  8 ++-
 libraries/template-haskell/template-haskell.cabal  |  1 +
 rules/foreachLibrary.mk                            |  4 +-
 testsuite/tests/codeGen/should_compile/jmp_tbl.hs  |  2 +-
 testsuite/tests/th/T10796a.hs                      | 15 +++++
 testsuite/tests/th/T10796b.hs                      |  8 +++
 testsuite/tests/th/T10796b.stderr                  |  5 ++
 testsuite/tests/th/TH_Roles2.stderr                |  6 +-
 testsuite/tests/th/TH_nameSpace.hs                 | 15 +++++
 testsuite/tests/th/TH_nameSpace.stdout             |  5 ++
 testsuite/tests/th/all.T                           |  3 +
 utils/ghc-pkg/ghc-pkg.cabal                        |  2 +-
 24 files changed, 195 insertions(+), 59 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 d2f9972a35ce05ceb8a78893e433ef1df06f73ef


More information about the ghc-commits mailing list