[commit: ghc] ghc-8.0: Fix Template Haskell's handling of infix GADT constructors (9578cb2)

git at git.haskell.org git at git.haskell.org
Fri Jan 8 11:25:11 UTC 2016


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

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/9578cb21275b85f5f80e01d7ea70157d8b71e9eb/ghc

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

commit 9578cb21275b85f5f80e01d7ea70157d8b71e9eb
Author: RyanGlScott <ryan.gl.scott at gmail.com>
Date:   Fri Jan 8 11:46:10 2016 +0100

    Fix Template Haskell's handling of infix GADT constructors
    
    This is the second (and hopefully last) fix needed to make TH handle
    GADTs properly (after D1465). This Diff addresses some issues with infix
    GADT constructors, specifically:
    
    * Before, you could not determine if a GADT constructor was declared
      infix because TH did not give you the ability to determine if there is
      a //user-specified// fixity declaration for that constructor. The
      return type of `reifyFixity` was changed to `Maybe Fixity` so that it
      yields `Just` the fixity is there is a fixity declaration, and
      `Nothing` otherwise (indicating it has `defaultFixity`).
    * `DsMeta`/`Convert` were changed so that infix GADT constructors are
      turned into `GadtC`, not `InfixC` (which should be reserved for
      Haskell98 datatype declarations).
    * Some minor fixes to the TH pretty-printer so that infix GADT
      constructors will be parenthesized in GADT signatures.
    
    Fixes #11345.
    
    Test Plan: ./validate
    
    Reviewers: goldfire, austin, bgamari, jstolarek
    
    Reviewed By: jstolarek
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1744
    
    GHC Trac Issues: #11345
    
    (cherry picked from commit a701a813dcfe7850bbc3c8a220c80e1dada93f49)


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

9578cb21275b85f5f80e01d7ea70157d8b71e9eb
 compiler/deSugar/DsMeta.hs                         |  6 ++-
 compiler/typecheck/TcSplice.hs                     | 29 ++++++++++++--
 libraries/ghci/GHCi/Message.hs                     |  2 +-
 .../template-haskell/Language/Haskell/TH/Ppr.hs    | 21 +++++++---
 .../template-haskell/Language/Haskell/TH/Syntax.hs | 11 ++++--
 libraries/template-haskell/changelog.md            |  6 +++
 testsuite/tests/th/T10704.stdout                   | 32 +++++++--------
 testsuite/tests/th/T11345.hs                       | 45 ++++++++++++++++++++++
 testsuite/tests/th/T11345.stdout                   | 10 +++++
 testsuite/tests/th/all.T                           |  1 +
 10 files changed, 130 insertions(+), 33 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 9578cb21275b85f5f80e01d7ea70157d8b71e9eb


More information about the ghc-commits mailing list