File tree Expand file tree Collapse file tree 10 files changed +15
-17
lines changed
Cabal-syntax/src/Distribution
cabal-install/src/Distribution/Client Expand file tree Collapse file tree 10 files changed +15
-17
lines changed Original file line number Diff line number Diff line change 47
47
- ignore : {name: "Use fst"} # 2 hints
48
48
- ignore : {name: "Use lambda-case"} # 58 hints
49
49
- ignore : {name: "Use list comprehension"} # 19 hints
50
- - ignore : {name: "Use list literal"} # 3 hints
51
- - ignore : {name: "Use list literal pattern"} # 11 hints
52
50
- ignore : {name: "Use map once"} # 7 hints
53
51
- ignore : {name: "Use map with tuple-section"} # 3 hints
54
52
- ignore : {name: "Use mapMaybe"} # 13 hints
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ components :: ModuleName -> [String]
116
116
components mn = split (unModuleName mn)
117
117
where
118
118
split cs = case break (== ' .' ) cs of
119
- (chunk, [] ) -> chunk : [ ]
119
+ (chunk, [] ) -> [chunk ]
120
120
(chunk, _ : rest) -> chunk : split rest
121
121
122
122
-- | Convert a module name to a file path, but without any file extension.
Original file line number Diff line number Diff line change @@ -141,13 +141,13 @@ mkVersion :: [Int] -> Version
141
141
-- TODO: add validity check; disallow 'mkVersion []' (we have
142
142
-- 'nullVersion' for that)
143
143
mkVersion [] = nullVersion
144
- mkVersion (v1 : [] )
144
+ mkVersion [v1]
145
145
| inWord16VerRep1 v1 = PV0 (mkWord64VerRep1 v1)
146
146
| otherwise = PV1 v1 []
147
147
where
148
148
inWord16VerRep1 x1 = inWord16 (x1 .|. (x1 + 1 ))
149
149
mkWord64VerRep1 y1 = mkWord64VerRep (y1 + 1 ) 0 0 0
150
- mkVersion (v1 : vs@ (v2 : [] ) )
150
+ mkVersion (v1 : vs@ [v2] )
151
151
| inWord16VerRep2 v1 v2 = PV0 (mkWord64VerRep2 v1 v2)
152
152
| otherwise = PV1 v1 vs
153
153
where
@@ -159,7 +159,7 @@ mkVersion (v1 : vs@(v2 : []))
159
159
.|. (x2 + 1 )
160
160
)
161
161
mkWord64VerRep2 y1 y2 = mkWord64VerRep (y1 + 1 ) (y2 + 1 ) 0 0
162
- mkVersion (v1 : vs@ (v2 : v3 : [] ) )
162
+ mkVersion (v1 : vs@ [v2, v3] )
163
163
| inWord16VerRep3 v1 v2 v3 = PV0 (mkWord64VerRep3 v1 v2 v3)
164
164
| otherwise = PV1 v1 vs
165
165
where
@@ -173,7 +173,7 @@ mkVersion (v1 : vs@(v2 : v3 : []))
173
173
.|. (x3 + 1 )
174
174
)
175
175
mkWord64VerRep3 y1 y2 y3 = mkWord64VerRep (y1 + 1 ) (y2 + 1 ) (y3 + 1 ) 0
176
- mkVersion (v1 : vs@ (v2 : v3 : v4 : [] ) )
176
+ mkVersion (v1 : vs@ [v2, v3, v4] )
177
177
| inWord16VerRep4 v1 v2 v3 v4 = PV0 (mkWord64VerRep4 v1 v2 v3 v4)
178
178
| otherwise = PV1 v1 vs
179
179
where
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ isAnyVersionLight _vr = False
183
183
isWildcardRange :: Version -> Version -> Bool
184
184
isWildcardRange ver1 ver2 = check (versionNumbers ver1) (versionNumbers ver2)
185
185
where
186
- check (n : [] ) (m : [] ) | n + 1 == m = True
186
+ check [n] [m] | n + 1 == m = True
187
187
check (n : ns) (m : ms) | n == m = check ns ms
188
188
check _ _ = False
189
189
Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ getOpt' ordering optDescr (arg : args) = procNextOpt opt ordering
230
230
231
231
-- take a look at the next cmd line arg and decide what to do with it
232
232
getNext :: String -> [String ] -> [OptDescr a ] -> (OptKind a , [String ])
233
- getNext ( ' -' : ' -' : [] ) rest _ = (EndOfOpts , rest)
233
+ getNext [ ' -' , ' -' ] rest _ = (EndOfOpts , rest)
234
234
getNext (' -' : ' -' : xs) rest optDescr = longOpt xs rest optDescr
235
235
getNext (' -' : x : xs) rest optDescr = shortOpt x xs rest optDescr
236
236
getNext a rest _ = (NonOpt a, rest)
Original file line number Diff line number Diff line change @@ -905,8 +905,8 @@ renderGhcOptions comp _platform@(Platform _arch os) opts
905
905
, if null (ghcOptInstantiatedWith opts)
906
906
then []
907
907
else
908
- " -instantiated-with"
909
- : intercalate
908
+ [ " -instantiated-with"
909
+ , intercalate
910
910
" ,"
911
911
( map
912
912
( \ (n, m) ->
@@ -916,7 +916,7 @@ renderGhcOptions comp _platform@(Platform _arch os) opts
916
916
)
917
917
(ghcOptInstantiatedWith opts)
918
918
)
919
- : [ ]
919
+ ]
920
920
, concat [[" -fno-code" , " -fwrite-interface" ] | flagBool ghcOptNoCode]
921
921
, [" -hide-all-packages" | flagBool ghcOptHideAllPackages]
922
922
, [" -Wmissing-home-modules" | flagBool ghcOptWarnMissingHomeModules]
Original file line number Diff line number Diff line change @@ -1594,7 +1594,7 @@ createDirectoryIfMissingVerbose verbosity create_parents path0
1594
1594
parents = reverse . scanl1 (</>) . splitDirectories . normalise
1595
1595
1596
1596
createDirs [] = return ()
1597
- createDirs (dir : [] ) = createDir dir throwIO
1597
+ createDirs [dir] = createDir dir throwIO
1598
1598
createDirs (dir : dirs) =
1599
1599
createDir dir $ \ _ -> do
1600
1600
createDirs dirs
Original file line number Diff line number Diff line change @@ -2104,5 +2104,5 @@ monoidFieldParsec name showF readF get' set =
2104
2104
showTokenQ :: String -> Doc
2105
2105
showTokenQ " " = Disp. empty
2106
2106
showTokenQ x@ (' -' : ' -' : _) = Disp. text (show x)
2107
- showTokenQ x@ ( ' .' : [] ) = Disp. text (show x)
2107
+ showTokenQ x@ [ ' .' ] = Disp. text (show x)
2108
2108
showTokenQ x = showToken x
Original file line number Diff line number Diff line change @@ -1496,9 +1496,9 @@ dieOnBuildFailures verbosity currentCommand plan buildOutcomes
1496
1496
renderDependencyOf pkgid =
1497
1497
case ultimateDeps pkgid of
1498
1498
[] -> " "
1499
- (p1 : [] ) ->
1499
+ [p1] ->
1500
1500
" (which is required by " ++ elabPlanPackageName verbosity p1 ++ " )"
1501
- (p1 : p2 : [] ) ->
1501
+ [p1, p2] ->
1502
1502
" (which is required by "
1503
1503
++ elabPlanPackageName verbosity p1
1504
1504
++ " and "
Original file line number Diff line number Diff line change @@ -637,7 +637,7 @@ gitProgram =
637
637
where
638
638
isTypical c = isDigit c || c == ' .'
639
639
split cs = case break (== ' .' ) cs of
640
- (chunk, [] ) -> chunk : [ ]
640
+ (chunk, [] ) -> [chunk ]
641
641
(chunk, _ : rest) -> chunk : split rest
642
642
643
643
-- | VCS driver for Mercurial.
You can’t perform that action at this time.
0 commit comments