diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2015-11-11 12:03:18 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-11-11 12:04:22 +0100 |
commit | f0f9365fd7fe1a4c06926f390a6183449c3c6332 (patch) | |
tree | 01881be0270596fa3c36acf882a9f63138fe8f75 /compiler/deSugar/DsBinds.hs | |
parent | ea8c116ac9eb916fdb6360a01c285bc8698dfaf9 (diff) | |
download | haskell-f0f9365fd7fe1a4c06926f390a6183449c3c6332.tar.gz |
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
Diffstat (limited to 'compiler/deSugar/DsBinds.hs')
-rw-r--r-- | compiler/deSugar/DsBinds.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/deSugar/DsBinds.hs b/compiler/deSugar/DsBinds.hs index 93b50dfc7c..47a3419bcc 100644 --- a/compiler/deSugar/DsBinds.hs +++ b/compiler/deSugar/DsBinds.hs @@ -108,10 +108,9 @@ dsHsBind (VarBind { var_id = var, var_rhs = expr, var_inline = inline_regardless ; return (unitOL (makeCorePair dflags var' False 0 core_expr)) } dsHsBind (FunBind { fun_id = L _ fun, fun_matches = matches - , fun_co_fn = co_fn, fun_tick = tick - , fun_infix = inf }) + , fun_co_fn = co_fn, fun_tick = tick }) = do { dflags <- getDynFlags - ; (args, body) <- matchWrapper (FunRhs (idName fun) inf) matches + ; (args, body) <- matchWrapper (FunRhs (idName fun)) matches ; let body' = mkOptTickBox tick body ; rhs <- dsHsWrapper co_fn (mkLams args body') ; {- pprTrace "dsHsBind" (ppr fun <+> ppr (idInlinePragma fun)) $ -} |