Skip to content

Commit

Permalink
Merge pull request haskell#97 from BinderDavid/drop-unused-cpp-2
Browse files Browse the repository at this point in the history
Remove CPP which was used for compatibility with GHC < 8.*
  • Loading branch information
Mikolaj authored Jun 13, 2023
2 parents b3de900 + b3c2391 commit 4e26bd1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
7 changes: 0 additions & 7 deletions GhcEvents.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# LANGUAGE CPP #-}

module Main where

import GHC.RTS.Events
Expand Down Expand Up @@ -252,8 +250,3 @@ showMap showKey showValue m =
concat $ zipWith (++)
(map showKey . M.keys $ m :: [String])
(map (showValue . (M.!) m) . M.keys $ m :: [String])

#if !MIN_VERSION_base(4,8,0)
die :: String -> IO a
die err = hPutStrLn stderr err >> exitFailure
#endif
5 changes: 0 additions & 5 deletions src/GHC/RTS/Events.hs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ import GHC.RTS.EventTypes
import GHC.RTS.Events.Binary
import GHC.RTS.Events.Incremental

#if !MIN_VERSION_base(4, 8, 0)
import Data.Foldable (foldMap)
import Data.Monoid (mempty)
#endif

#if !MIN_VERSION_base(4, 11, 0)
import Data.Monoid ((<>))
#endif
Expand Down
4 changes: 0 additions & 4 deletions src/GHC/RTS/Events/Incremental.hs
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ readEvents :: Header -> BL.ByteString -> ([Event], Maybe String)
readEvents header = f . break isLeft . readEvents' header
where
f (rs, ls) = (rights rs, listToMaybe (lefts ls))
#if !MIN_VERSION_base(4, 7, 0)
isLeft (Left _) = True
isLeft _ = False
#endif

-- | Read events from a lazy bytestring. It returns an error message if it
-- encounters an error while decoding the header.
Expand Down

0 comments on commit 4e26bd1

Please sign in to comment.