[commit: ghc] master: Remove fun_infix from Funbind, as it is now in Match (f0f9365)

git at git.haskell.org git at git.haskell.org
Wed Nov 11 11:27:01 UTC 2015


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

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

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

commit f0f9365fd7fe1a4c06926f390a6183449c3c6332
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   Wed Nov 11 12:03:18 2015 +0100

    Remove fun_infix from Funbind, as it is now in Match
    
    One of the changes D538 introduced is to add `m_fun_id_infix` to `Match`
    
    ```lang=hs
    data Match id body
      = Match {
            m_fun_id_infix :: (Maybe (Located id,Bool)),
              -- fun_id and fun_infix for functions with multiple equations
              -- only present for a RdrName. See note [fun_id in Match]
            m_pats :: [LPat id], -- The patterns
            m_type :: (Maybe (LHsType id)),
                                     -- A type signature for the result of the match
                                     -- Nothing after typechecking
            m_grhss :: (GRHSs id body)
      } deriving (Typeable)
    ```
    
    This was done to track the individual locations and fixity of the
    `fun_id` for each of the defining equations for a function when there
    are more than one.
    
    For example, the function `(&&&)` is defined with some prefix and some
    infix equations below.
    
    ```lang=hs
        (&&&  ) [] [] =  []
        xs    &&&   [] =  xs
        (  &&&  ) [] ys =  ys
    ```
    
    This means that the fun_infix is now superfluous in the `FunBind`. This
    has not been removed as a potentially risky change just before 7.10 RC2,
    and so must be done after.
    
    This ticket captures that task, which includes processing these fields
    through the renamer and beyond.
    
    Ticket #9988 introduced these fields into `Match` through renaming, this
    ticket it to continue through type checking and then remove it from
    `FunBind` completely.
    
    The split happened so that #9988 could land in 7.10
    
    Trac ticket : #10061
    
    Test Plan: ./validate
    
    Reviewers: goldfire, austin, simonpj, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: simonpj, thomie, mpickering
    
    Differential Revision: https://phabricator.haskell.org/D1285
    
    GHC Trac Issues: #10061


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

f0f9365fd7fe1a4c06926f390a6183449c3c6332
 compiler/deSugar/DsBinds.hs          |  5 ++--
 compiler/deSugar/DsExpr.hs           |  4 +--
 compiler/deSugar/Match.hs            |  4 +--
 compiler/hsSyn/Convert.hs            |  4 +--
 compiler/hsSyn/HsBinds.hs            | 18 +++++------
 compiler/hsSyn/HsExpr.hs             | 58 ++++++++++++++++++++++--------------
 compiler/hsSyn/HsExpr.hs-boot        |  2 +-
 compiler/hsSyn/HsUtils.hs            | 19 +++++++++---
 compiler/parser/Parser.y             |  6 ++--
 compiler/parser/RdrHsSyn.hs          | 34 +++++++++++----------
 compiler/rename/RnBinds.hs           | 15 +++++-----
 compiler/typecheck/TcArrows.hs       |  2 +-
 compiler/typecheck/TcBinds.hs        | 22 +++++++-------
 compiler/typecheck/TcMatches.hs      |  8 ++---
 compiler/typecheck/TcMatches.hs-boot |  2 +-
 compiler/typecheck/TcPatSyn.hs       |  6 ++--
 16 files changed, 116 insertions(+), 93 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 f0f9365fd7fe1a4c06926f390a6183449c3c6332


More information about the ghc-commits mailing list