File tree Expand file tree Collapse file tree 4 files changed +7
-12
lines changed
Cabal-syntax/src/Distribution/Utils
Cabal/src/Distribution/Simple/FileMonitor
cabal-install/src/Distribution/Client Expand file tree Collapse file tree 4 files changed +7
-12
lines changed Original file line number Diff line number Diff line change 47
47
- ignore : {name: "Use fromMaybe"} # 5 hints
48
48
- ignore : {name: "Use fst"} # 2 hints
49
49
- ignore : {name: "Use infix"} # 20 hints
50
- - ignore : {name: "Use isAsciiLower"} # 2 hints
51
- - ignore : {name: "Use isAsciiUpper"} # 2 hints
52
- - ignore : {name: "Use isDigit"} # 2 hints
53
50
- ignore : {name: "Use lambda-case"} # 58 hints
54
51
- ignore : {name: "Use list comprehension"} # 19 hints
55
52
- ignore : {name: "Use list literal"} # 3 hints
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ module Distribution.Utils.Generic
85
85
import Distribution.Compat.Prelude
86
86
import Prelude ()
87
87
88
+ import Data.Char (isAsciiLower , isAsciiUpper )
88
89
import Distribution.Utils.String
89
90
90
91
import Data.Bits (shiftL , (.&.) , (.|.) )
@@ -449,9 +450,7 @@ isAscii c = fromEnum c < 0x80
449
450
450
451
-- | Ascii letters.
451
452
isAsciiAlpha :: Char -> Bool
452
- isAsciiAlpha c =
453
- (' a' <= c && c <= ' z' )
454
- || (' A' <= c && c <= ' Z' )
453
+ isAsciiAlpha c = (isAsciiLower c) || (isAsciiUpper c)
455
454
456
455
-- | Ascii letters and digits.
457
456
--
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import Distribution.Simple.Glob.Internal
39
39
import qualified Distribution.Compat.CharParsing as P
40
40
import Distribution.Parsec
41
41
import Distribution.Pretty
42
+ import Distribution.Utils.Generic (isAsciiAlpha )
42
43
import qualified Text.PrettyPrint as Disp
43
44
44
45
--------------------------------------------------------------------------------
@@ -211,7 +212,7 @@ instance Parsec FilePathRoot where
211
212
root = FilePathRoot " /" <$ P. char ' /'
212
213
home = FilePathHomeDir <$ P. string " ~/"
213
214
drive = do
214
- dr <- P. satisfy $ \ c -> (c >= ' a ' && c <= ' z ' ) || (c >= ' A ' && c <= ' Z ' )
215
+ dr <- P. satisfy isAsciiAlpha
215
216
_ <- P. char ' :'
216
217
_ <- P. char ' /' <|> P. char ' \\ '
217
218
return (FilePathRoot (toUpper dr : " :\\ " ))
Original file line number Diff line number Diff line change @@ -629,14 +629,13 @@ gitProgram =
629
629
-- or annoyingly "git version 2.17.1.windows.2" yes, really
630
630
(_ : _ : ver : _) ->
631
631
intercalate " ."
632
- . takeWhile (all isNum )
632
+ . takeWhile (all isDigit )
633
633
. split
634
634
$ ver
635
635
_ -> " "
636
636
}
637
637
where
638
- isNum c = c >= ' 0' && c <= ' 9'
639
- isTypical c = isNum c || c == ' .'
638
+ isTypical c = isDigit c || c == ' .'
640
639
split cs = case break (== ' .' ) cs of
641
640
(chunk, [] ) -> chunk : []
642
641
(chunk, _ : rest) -> chunk : split rest
@@ -924,5 +923,4 @@ pijulProgram =
924
923
_ -> " "
925
924
}
926
925
where
927
- isNum c = c >= ' 0' && c <= ' 9'
928
- isTypical c = isNum c || c == ' .'
926
+ isTypical c = isDigit c || c == ' .'
You can’t perform that action at this time.
0 commit comments