[commit: ghc] master: Add infix flag for class and data declarations (8f6d241)

git at git.haskell.org git at git.haskell.org
Mon Dec 12 18:51:11 UTC 2016


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

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

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

commit 8f6d241a74efa6f6280689a9b14c36c6a9f4c231
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   Thu Dec 8 10:43:32 2016 +0200

    Add infix flag for class and data declarations
    
    Summary:
    At the moment, data and type declarations using infix formatting produce the
    same AST as those using prefix.
    
    So
    
        type a ++ b = c
    
    and
    
        type (++) a b = c
    
    cannot be distinguished in the parsed source, without looking at the OccName
    details of the constructor being defined.
    
    Having access to the OccName requires an additional constraint which explodes
    out over the entire AST because of its recursive definitions.
    
    In keeping with moving the parsed source to more directly reflect the source
    code as parsed, add a specific flag to the declaration to indicate the fixity,
    as used in a Match now too.
    
    Note: this flag is to capture the fixity used for the lexical definition of the
    type, primarily for use by ppr and ghc-exactprint.
    
    Updates haddock submodule.
    
    Test Plan: ./validate
    
    Reviewers: mpickering, goldfire, bgamari, austin
    
    Reviewed By: mpickering
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2828
    
    GHC Trac Issues: #12942


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

8f6d241a74efa6f6280689a9b14c36c6a9f4c231
 compiler/basicTypes/BasicTypes.hs   |  12 ++-
 compiler/hsSyn/Convert.hs           |  17 +++--
 compiler/hsSyn/HsBinds.hs           |  34 ++++-----
 compiler/hsSyn/HsDecls.hs           | 144 +++++++++++++++++-------------------
 compiler/hsSyn/HsExpr.hs            | 127 ++++++++++++-------------------
 compiler/hsSyn/HsExpr.hs-boot       |  19 ++---
 compiler/hsSyn/HsLit.hs             |   5 +-
 compiler/hsSyn/HsPat.hs             |  17 ++---
 compiler/hsSyn/HsPat.hs-boot        |   4 +-
 compiler/hsSyn/HsSyn.hs             |   5 +-
 compiler/hsSyn/HsTypes.hs           |  67 +++++++----------
 compiler/hsSyn/PlaceHolder.hs       |   7 --
 compiler/main/GHC.hs                |   1 +
 compiler/parser/RdrHsSyn.hs         |  64 +++++++++-------
 compiler/rename/RnBinds.hs          |   2 +-
 compiler/rename/RnSource.hs         |  22 +++++-
 compiler/rename/RnTypes.hs          |   2 +-
 compiler/typecheck/TcAnnotations.hs |   2 +-
 compiler/typecheck/TcBinds.hs       |   2 +-
 compiler/typecheck/TcEnv.hs         |   5 +-
 compiler/typecheck/TcGenFunctor.hs  |   1 +
 compiler/typecheck/TcMatches.hs     |   1 +
 compiler/typecheck/TcPat.hs         |   3 +-
 compiler/typecheck/TcPatSyn.hs      |   9 +--
 compiler/utils/BooleanFormula.hs    |   7 +-
 utils/haddock                       |   2 +-
 26 files changed, 271 insertions(+), 310 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 8f6d241a74efa6f6280689a9b14c36c6a9f4c231


More information about the ghc-commits mailing list