File tree 1 file changed +6
-2
lines changed
Cabal/Distribution/Simple/Program 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ import qualified Data.Map as Map
46
46
import Data.Monoid (All (.. ), Any (.. ), Endo (.. ), First (.. ))
47
47
import Data.Set (Set )
48
48
import qualified Data.Set as Set
49
- import Text.Read (readMaybe )
50
49
51
50
normaliseGhcArgs :: Maybe Version -> PackageDescription -> [String ] -> [String ]
52
51
normaliseGhcArgs (Just ghcVersion) PackageDescription {.. } ghcArgs
@@ -152,7 +151,7 @@ normaliseGhcArgs (Just ghcVersion) PackageDescription{..} ghcArgs
152
151
, isOptIntFlag
153
152
, isIntFlag
154
153
, if safeToFilterWarnings
155
- then isWarning <> Any . (" -w" == )
154
+ then isWarning <> ( Any . (" -w" == ) )
156
155
else mempty
157
156
]
158
157
@@ -205,6 +204,11 @@ normaliseGhcArgs (Just ghcVersion) PackageDescription{..} ghcArgs
205
204
parseInt :: String -> Maybe Int
206
205
parseInt = readMaybe . dropEq
207
206
207
+ readMaybe :: Read a => String -> Maybe a
208
+ readMaybe s = case reads s of
209
+ [(x, " " )] -> Just x
210
+ _ -> Nothing
211
+
208
212
dropEq :: String -> String
209
213
dropEq (' =' : s) = s
210
214
dropEq s = s
You can’t perform that action at this time.
0 commit comments