Skip to content

Commit 98b4f51

Browse files
committed
Fix GHC 7.4 compilation errors.
1 parent 338da71 commit 98b4f51

File tree

1 file changed

+6
-2
lines changed
  • Cabal/Distribution/Simple/Program

1 file changed

+6
-2
lines changed

Cabal/Distribution/Simple/Program/GHC.hs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import qualified Data.Map as Map
4646
import Data.Monoid (All(..), Any(..), Endo(..), First(..))
4747
import Data.Set (Set)
4848
import qualified Data.Set as Set
49-
import Text.Read (readMaybe)
5049

5150
normaliseGhcArgs :: Maybe Version -> PackageDescription -> [String] -> [String]
5251
normaliseGhcArgs (Just ghcVersion) PackageDescription{..} ghcArgs
@@ -152,7 +151,7 @@ normaliseGhcArgs (Just ghcVersion) PackageDescription{..} ghcArgs
152151
, isOptIntFlag
153152
, isIntFlag
154153
, if safeToFilterWarnings
155-
then isWarning <> Any . ("-w"==)
154+
then isWarning <> (Any . ("-w"==))
156155
else mempty
157156
]
158157

@@ -205,6 +204,11 @@ normaliseGhcArgs (Just ghcVersion) PackageDescription{..} ghcArgs
205204
parseInt :: String -> Maybe Int
206205
parseInt = readMaybe . dropEq
207206

207+
readMaybe :: Read a => String -> Maybe a
208+
readMaybe s = case reads s of
209+
[(x, "")] -> Just x
210+
_ -> Nothing
211+
208212
dropEq :: String -> String
209213
dropEq ('=':s) = s
210214
dropEq s = s

0 commit comments

Comments
 (0)