diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2022-11-14 19:30:50 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-11-16 14:50:06 -0500 |
commit | 37cfe3c0f4fb16189bbe3bb735f758cd6e3d9157 (patch) | |
tree | f4084bab4c1d5a71a24d8b67677bef5061a6b08a /compiler/GHC/Driver | |
parent | 08bf28819b78e740550a73a90eda62cce8d21c90 (diff) | |
download | haskell-37cfe3c0f4fb16189bbe3bb735f758cd6e3d9157.tar.gz |
Misc cleanup
* Replace catMaybes . map f with mapMaybe f
* Use concatFS to concatenate multiple FastStrings
* Fix documentation of -exclude-module
* Cleanup getIgnoreCount in GHCi.UI
Diffstat (limited to 'compiler/GHC/Driver')
-rw-r--r-- | compiler/GHC/Driver/Backpack.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Driver/GenerateCgIPEStub.hs | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/compiler/GHC/Driver/Backpack.hs b/compiler/GHC/Driver/Backpack.hs index 93422e4161..cf94e0cf1d 100644 --- a/compiler/GHC/Driver/Backpack.hs +++ b/compiler/GHC/Driver/Backpack.hs @@ -939,4 +939,4 @@ hsModuleToModSummary home_keys pn hsc_src modname newUnitId :: UnitId -> Maybe FastString -> UnitId newUnitId uid mhash = case mhash of Nothing -> uid - Just hash -> UnitId (unitIdFS uid `appendFS` mkFastString "+" `appendFS` hash) + Just hash -> UnitId (concatFS [unitIdFS uid, fsLit "+", hash]) diff --git a/compiler/GHC/Driver/GenerateCgIPEStub.hs b/compiler/GHC/Driver/GenerateCgIPEStub.hs index be478f1bdb..40927bbc6e 100644 --- a/compiler/GHC/Driver/GenerateCgIPEStub.hs +++ b/compiler/GHC/Driver/GenerateCgIPEStub.hs @@ -3,7 +3,7 @@ module GHC.Driver.GenerateCgIPEStub (generateCgIPEStub) where import qualified Data.Map.Strict as Map -import Data.Maybe (catMaybes, listToMaybe) +import Data.Maybe (mapMaybe, listToMaybe) import GHC.Cmm import GHC.Cmm.CLabel (CLabel) import GHC.Cmm.Dataflow (Block, C, O) @@ -210,7 +210,7 @@ generateCgIPEStub hsc_env this_mod denv s = do collectNothing _ cmmGroupSRTs = pure ([], cmmGroupSRTs) collectInfoTables :: CmmGroupSRTs -> [(Label, CmmInfoTable)] - collectInfoTables cmmGroup = concat $ catMaybes $ map extractInfoTables cmmGroup + collectInfoTables cmmGroup = concat $ mapMaybe extractInfoTables cmmGroup extractInfoTables :: GenCmmDecl RawCmmStatics CmmTopInfo CmmGraph -> Maybe [(Label, CmmInfoTable)] extractInfoTables (CmmProc h _ _ _) = Just $ mapToList (info_tbls h) @@ -249,8 +249,7 @@ generateCgIPEStub hsc_env this_mod denv s = do lastTickInBlock block = listToMaybe $ - catMaybes $ - map maybeTick $ (reverse . blockToList) block + mapMaybe maybeTick $ (reverse . blockToList) block maybeTick :: CmmNode O O -> Maybe IpeSourceLocation maybeTick (CmmTick (SourceNote span name)) = Just (span, name) |