X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FdeSugar%2FDsUtils.lhs;fp=compiler%2FdeSugar%2FDsUtils.lhs;h=cf171ce537a0640945af032b17154175598508c3;hp=553b4688322f3d361cc6135d1c4e5aafb289909a;hb=4edf8929c0007b6626c32e382a337afc2c8a75ab;hpb=9aa2708bf96c82e255fd3c9cb0a07af2cceb296b diff --git a/compiler/deSugar/DsUtils.lhs b/compiler/deSugar/DsUtils.lhs index 553b468..cf171ce 100644 --- a/compiler/deSugar/DsUtils.lhs +++ b/compiler/deSugar/DsUtils.lhs @@ -797,17 +797,18 @@ mkLHsVarTup ids = mkLHsTup (map nlHsVar ids) mkLHsTup :: [LHsExpr Id] -> LHsExpr Id mkLHsTup [] = nlHsVar unitDataConId mkLHsTup [lexp] = lexp -mkLHsTup lexps = noLoc $ ExplicitTuple lexps Boxed - +mkLHsTup lexps = L (getLoc (head lexps)) $ + ExplicitTuple lexps Boxed -- Smart constructors for source tuple patterns mkLHsVarPatTup :: [Id] -> LPat Id mkLHsVarPatTup bs = mkLHsPatTup (map nlVarPat bs) mkLHsPatTup :: [LPat Id] -> LPat Id +mkLHsPatTup [] = noLoc $ mkVanillaTuplePat [] Boxed mkLHsPatTup [lpat] = lpat -mkLHsPatTup lpats = noLoc $ mkVanillaTuplePat lpats Boxed -- Handles the case where lpats = [] gracefully - +mkLHsPatTup lpats = L (getLoc (head lpats)) $ + mkVanillaTuplePat lpats Boxed -- The Big equivalents for the source tuple expressions mkBigLHsVarTup :: [Id] -> LHsExpr Id @@ -823,7 +824,6 @@ mkBigLHsVarPatTup bs = mkBigLHsPatTup (map nlVarPat bs) mkBigLHsPatTup :: [LPat Id] -> LPat Id mkBigLHsPatTup = mkBigTuple mkLHsPatTup - \end{code}