diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-07-31 13:27:54 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2017-07-31 13:36:49 +0100 |
commit | 4fdc523456ff6481df8d7483ae193f0c2dc2b3fe (patch) | |
tree | 26d747a4df84e1fd810b61a29c3ba36c46e0252c /compiler/hsSyn/HsUtils.hs | |
parent | 7f2dee8e5de5dbc09a7fb66ec54fd41ab4b1b2eb (diff) | |
download | haskell-4fdc523456ff6481df8d7483ae193f0c2dc2b3fe.tar.gz |
Use field names for all uses of datacon Match
This is refactoring only... elimiante all positional uses
of the data constructor Match in favour of field names.
No change in behaviour.
Diffstat (limited to 'compiler/hsSyn/HsUtils.hs')
-rw-r--r-- | compiler/hsSyn/HsUtils.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs index f409c2a7d2..97ab76f986 100644 --- a/compiler/hsSyn/HsUtils.hs +++ b/compiler/hsSyn/HsUtils.hs @@ -146,7 +146,8 @@ mkSimpleMatch :: HsMatchContext (NameOrRdrName (IdP id)) -> LMatch id (Located (body id)) mkSimpleMatch ctxt pats rhs = L loc $ - Match ctxt pats Nothing (unguardedGRHSs rhs) + Match { m_ctxt = ctxt, m_pats = pats, m_type = Nothing + , m_grhss = unguardedGRHSs rhs } where loc = case pats of [] -> getLoc rhs @@ -766,8 +767,10 @@ mkPrefixFunRhs n = FunRhs { mc_fun = n mkMatch :: HsMatchContext (NameOrRdrName (IdP p)) -> [LPat p] -> LHsExpr p -> Located (HsLocalBinds p) -> LMatch p (LHsExpr p) mkMatch ctxt pats expr lbinds - = noLoc (Match ctxt (map paren pats) Nothing - (GRHSs (unguardedRHS noSrcSpan expr) lbinds)) + = noLoc (Match { m_ctxt = ctxt + , m_pats = map paren pats + , m_type = Nothing + , m_grhss = GRHSs (unguardedRHS noSrcSpan expr) lbinds }) where paren lp@(L l p) | hsPatNeedsParens p = L l (ParPat lp) | otherwise = lp |