summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser/PostProcess.hs
diff options
context:
space:
mode:
authorHécate <hecate+gitlab@glitchbra.in>2020-10-10 21:15:36 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-11-01 01:11:09 -0400
commitdfd27445308d1ed2df8826c2a045130e918e8192 (patch)
tree99fc01edeebc2924ddb7533864e0d4ca18cfe800 /compiler/GHC/Parser/PostProcess.hs
parentbd4abdc953427e084e7ecba89db64860f6859822 (diff)
downloadhaskell-dfd27445308d1ed2df8826c2a045130e918e8192.tar.gz
Add the proper HLint rules and remove redundant keywords from compiler
Diffstat (limited to 'compiler/GHC/Parser/PostProcess.hs')
-rw-r--r--compiler/GHC/Parser/PostProcess.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs
index 8e85c9493e..84aa3e09bc 100644
--- a/compiler/GHC/Parser/PostProcess.hs
+++ b/compiler/GHC/Parser/PostProcess.hs
@@ -810,7 +810,7 @@ mkRuleTyVarBndrs = fmap (fmap cvt_one)
-- See note [Parsing explicit foralls in Rules] in Parser.y
checkRuleTyVarBndrNames :: [LHsTyVarBndr flag GhcPs] -> P ()
checkRuleTyVarBndrNames = mapM_ (check . fmap hsTyVarName)
- where check (L loc (Unqual occ)) = do
+ where check (L loc (Unqual occ)) =
-- TODO: don't use string here, OccName has a Unique/FastString
when ((occNameString occ ==) `any` ["forall","family","role"])
(addFatalError $ Error (ErrParseErrorOnInput occ) [] loc)
@@ -878,8 +878,7 @@ checkCmdBlockArguments :: LHsCmd GhcPs -> PV ()
(checkExpBlockArguments, checkCmdBlockArguments) = (checkExpr, checkCmd)
where
checkExpr :: LHsExpr GhcPs -> PV ()
- checkExpr expr = do
- case unLoc expr of
+ checkExpr expr = case unLoc expr of
HsDo _ (DoExpr m) _ -> check (ErrDoInFunAppExpr m) expr
HsDo _ (MDoExpr m) _ -> check (ErrMDoInFunAppExpr m) expr
HsLam {} -> check ErrLambdaInFunAppExpr expr
@@ -1458,7 +1457,7 @@ instance DisambECP (HsExpr GhcPs) where
mkHsLetPV l bs c = return $ L l (HsLet noExtField bs c)
type InfixOp (HsExpr GhcPs) = HsExpr GhcPs
superInfixOp m = m
- mkHsOpAppPV l e1 op e2 = do
+ mkHsOpAppPV l e1 op e2 =
return $ L l $ OpApp noExtField e1 op e2
mkHsCasePV l e mg = return $ L l (HsCase noExtField e mg)
mkHsLamCasePV l mg = return $ L l (HsLamCase noExtField mg)