[commit: ghc] master: Remove uses of mkMatchGroupName (04184a2)
git at git.haskell.org
git at git.haskell.org
Sun Sep 11 13:39:06 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/04184a2a582d175dad4a696f5047cd66bfe26f8e/ghc
>---------------------------------------------------------------
commit 04184a2a582d175dad4a696f5047cd66bfe26f8e
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date: Sun Sep 11 14:35:27 2016 +0100
Remove uses of mkMatchGroupName
You can now just use `mkMatchGroup`.
>---------------------------------------------------------------
04184a2a582d175dad4a696f5047cd66bfe26f8e
compiler/hsSyn/HsUtils.hs | 8 ++------
compiler/rename/RnBinds.hs | 2 +-
compiler/typecheck/TcPatSyn.hs | 2 +-
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs
index 118e551..5e51272 100644
--- a/compiler/hsSyn/HsUtils.hs
+++ b/compiler/hsSyn/HsUtils.hs
@@ -22,7 +22,7 @@ module HsUtils(
-- Terms
mkHsPar, mkHsApp, mkHsAppType, mkHsAppTypeOut, mkHsConApp, mkHsCaseAlt,
mkSimpleMatch, unguardedGRHSs, unguardedRHS,
- mkMatchGroup, mkMatchGroupName, mkMatch, mkHsLam, mkHsIf,
+ mkMatchGroup, mkMatch, mkHsLam, mkHsIf,
mkHsWrap, mkLHsWrap, mkHsWrapCo, mkHsWrapCoR, mkLHsWrapCo,
mkHsDictLet, mkHsLams,
mkHsOpApp, mkHsDo, mkHsComp, mkHsWrapPat, mkHsWrapPatCo,
@@ -164,10 +164,6 @@ mkLocatedList :: [Located a] -> Located [Located a]
mkLocatedList [] = noLoc []
mkLocatedList ms = L (combineLocs (head ms) (last ms)) ms
-mkMatchGroupName :: Origin -> [LMatch Name (Located (body Name))]
- -> MatchGroup Name (Located (body Name))
-mkMatchGroupName = mkMatchGroup
-
mkHsApp :: LHsExpr name -> LHsExpr name -> LHsExpr name
mkHsApp e1 e2 = addCLoc e1 e2 (HsApp e1 e2)
@@ -703,7 +699,7 @@ mkTopFunBind :: Origin -> Located Name -> [LMatch Name (LHsExpr Name)]
-> HsBind Name
-- In Name-land, with empty bind_fvs
mkTopFunBind origin fn ms = FunBind { fun_id = fn
- , fun_matches = mkMatchGroupName origin ms
+ , fun_matches = mkMatchGroup origin ms
, fun_co_fn = idHsWrapper
, bind_fvs = emptyNameSet -- NB: closed
-- binding
diff --git a/compiler/rename/RnBinds.hs b/compiler/rename/RnBinds.hs
index 4af699a..1eadf29 100644
--- a/compiler/rename/RnBinds.hs
+++ b/compiler/rename/RnBinds.hs
@@ -1028,7 +1028,7 @@ rnMatchGroup ctxt rnBody (MG { mg_alts = L _ ms, mg_origin = origin })
= do { empty_case_ok <- xoptM LangExt.EmptyCase
; when (null ms && not empty_case_ok) (addErr (emptyCaseErr ctxt))
; (new_ms, ms_fvs) <- mapFvRn (rnMatch ctxt rnBody) ms
- ; return (mkMatchGroupName origin new_ms, ms_fvs) }
+ ; return (mkMatchGroup origin new_ms, ms_fvs) }
rnMatch :: Outputable (body RdrName) => HsMatchContext Name
-> (Located (body RdrName) -> RnM (Located (body Name), FreeVars))
diff --git a/compiler/typecheck/TcPatSyn.hs b/compiler/typecheck/TcPatSyn.hs
index 81a2029..548b746 100644
--- a/compiler/typecheck/TcPatSyn.hs
+++ b/compiler/typecheck/TcPatSyn.hs
@@ -555,7 +555,7 @@ tcPatSynBuilderBind (PSB { psb_id = L loc name, psb_def = lpat
Unidirectional -> panic "tcPatSynBuilderBind"
mk_mg :: LHsExpr Name -> MatchGroup Name (LHsExpr Name)
- mk_mg body = mkMatchGroupName Generated [builder_match]
+ mk_mg body = mkMatchGroup Generated [builder_match]
where
builder_args = [L loc (VarPat (L loc n)) | L loc n <- args]
builder_match = mkMatch (FunRhs (L loc name) Prefix)
More information about the ghc-commits
mailing list