summaryrefslogtreecommitdiff
path: root/compiler/main
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2020-02-17 09:56:33 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-20 21:20:45 -0500
commit65b7256a88ae2bd878da5d026e4183cba6f6eedf (patch)
treefeae01641c4fcbaa438dda9298d7d9ca2430eb85 /compiler/main
parentc8439fc789ff00cfdd453d2425d2146df69e0729 (diff)
downloadhaskell-65b7256a88ae2bd878da5d026e4183cba6f6eedf.tar.gz
Use concatMap(M) instead of `concat . map` and the monadic variant
Diffstat (limited to 'compiler/main')
-rw-r--r--compiler/main/DriverPipeline.hs4
-rw-r--r--compiler/main/HscMain.hs4
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 6fe8bc0d35..99a3ae9b70 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1534,7 +1534,7 @@ runPhase (RealPhase LlvmLlc) input_fn dflags
then map SysTools.Option $ words llvmOpts
else []
- defaultOptions = map SysTools.Option . concat . fmap words . snd
+ defaultOptions = map SysTools.Option . concatMap words . snd
$ unzip (llvmOptions dflags)
@@ -1948,7 +1948,7 @@ linkStaticLib dflags o_files dep_packages = do
(when output_exists) $ removeFile full_output_fn
pkg_cfgs <- getPreloadPackagesAnd dflags dep_packages
- archives <- concat <$> mapM (collectArchives dflags) pkg_cfgs
+ archives <- concatMapM (collectArchives dflags) pkg_cfgs
ar <- foldl mappend
<$> (Archive <$> mapM loadObj modules)
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs
index 709999e06a..4ca05e9657 100644
--- a/compiler/main/HscMain.hs
+++ b/compiler/main/HscMain.hs
@@ -1271,12 +1271,12 @@ markUnsafeInfer tcg_env whyUnsafe = do
(vcat $ pprErrMsgBagWithLoc whyUnsafe) $+$
(vcat $ badInsts $ tcg_insts tcg_env)
]
- badFlags df = concat $ map (badFlag df) unsafeFlagsForInfer
+ badFlags df = concatMap (badFlag df) unsafeFlagsForInfer
badFlag df (str,loc,on,_)
| on df = [mkLocMessage SevOutput (loc df) $
text str <+> text "is not allowed in Safe Haskell"]
| otherwise = []
- badInsts insts = concat $ map badInst insts
+ badInsts insts = concatMap badInst insts
checkOverlap (NoOverlap _) = False
checkOverlap _ = True