Skip to content

Commit a97185c

Browse files
committed
Follow hlint suggestion: Use section
1 parent 857e67e commit a97185c

File tree

12 files changed

+19
-20
lines changed

12 files changed

+19
-20
lines changed

.hlint.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@
5656
- ignore: {name: "Use record patterns"} # 16 hints
5757
- ignore: {name: "Use replicateM_"} # 2 hints
5858
- ignore: {name: "Use rights"} # 2 hints
59-
- ignore: {name: "Use section"} # 18 hints
6059
- ignore: {name: "Use tuple-section"} # 28 hints
6160
- ignore: {name: "Use typeRep"} # 2 hints
62-
- ignore: {name: "Use unless"} # 23 hints
61+
- ignore: {name: "Use unless"} # 23 hints+++++++++
6362
- ignore: {name: "Use unwords"} # 8 hints
6463
- ignore: {name: "Use void"} # 23 hints
6564

Cabal/src/Distribution/PackageDescription/Check.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ checkMissingDocs dgs esgs edgs efgs = do
10601060
-> [FilePath] -- Actuals.
10611061
-> [PackageCheck]
10621062
checkDoc b ds as =
1063-
let fds = map ("." </>) $ filter (flip notElem as) ds
1063+
let fds = map ("." </>) $ filter (`notElem` as) ds
10641064
in if null fds
10651065
then []
10661066
else
@@ -1075,7 +1075,7 @@ checkMissingDocs dgs esgs edgs efgs = do
10751075
-> [FilePath] -- Actuals.
10761076
-> [PackageCheck]
10771077
checkDocMove b field ds as =
1078-
let fds = filter (flip elem as) ds
1078+
let fds = filter (`elem` as) ds
10791079
in if null fds
10801080
then []
10811081
else

Cabal/src/Distribution/PackageDescription/Check/Target.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ checkLibrary
7979
checkP
8080
( not $
8181
all
82-
(flip elem (explicitLibModules lib))
82+
(`elem` (explicitLibModules lib))
8383
(libModulesAutogen lib)
8484
)
8585
(PackageBuildImpossible AutogenNotExposed)
@@ -172,7 +172,7 @@ checkExecutable
172172
-- Alas exeModules ad exeModulesAutogen (exported from
173173
-- Distribution.Types.Executable) take `Executable` as a parameter.
174174
checkP
175-
(not $ all (flip elem (exeModules exe)) (exeModulesAutogen exe))
175+
(not $ all (`elem` (exeModules exe)) (exeModulesAutogen exe))
176176
(PackageBuildImpossible $ AutogenNoOther cet)
177177
checkP
178178
( not $
@@ -218,7 +218,7 @@ checkTestSuite
218218
checkP
219219
( not $
220220
all
221-
(flip elem (testModules ts))
221+
(`elem` (testModules ts))
222222
(testModulesAutogen ts)
223223
)
224224
(PackageBuildImpossible $ AutogenNoOther cet)
@@ -280,7 +280,7 @@ checkBenchmark
280280
checkP
281281
( not $
282282
all
283-
(flip elem (benchmarkModules bm))
283+
(`elem` (benchmarkModules bm))
284284
(benchmarkModulesAutogen bm)
285285
)
286286
(PackageBuildImpossible $ AutogenNoOther cet)

Cabal/src/Distribution/Simple/Build.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ build_setupHooks
240240
, SetupHooks.targetInfo = target
241241
}
242242
for_ mbPostBuild ($ postBuildInputs)
243-
return (maybe index (Index.insert `flip` index) mb_ipi)
243+
return (maybe index (`Index.insert` index) mb_ipi)
244244

245245
return ()
246246
where

Cabal/src/Distribution/Utils/Progress.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ instance Monad (Progress step fail) where
6262

6363
instance Applicative (Progress step fail) where
6464
pure a = Done a
65-
p <*> x = foldProgress Step Fail (flip fmap x) p
65+
p <*> x = foldProgress Step Fail (`fmap` x) p
6666

6767
instance Monoid fail => Alternative (Progress step fail) where
6868
empty = Fail Mon.mempty

cabal-install-solver/src/Distribution/Solver/Modular/Preference.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ preferPackagePreferences pcs =
135135
preferred pn opt =
136136
let PackagePreferences vrs _ _ = pcs pn
137137
in fromIntegral . negate . L.length $
138-
L.filter (flip checkVR (version opt)) vrs
138+
L.filter (`checkVR` (version opt)) vrs
139139

140140
-- Prefer installed packages over non-installed packages.
141141
installed :: POption -> Weight

cabal-install-solver/src/Distribution/Solver/Types/Progress.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ instance Monad (Progress step fail) where
4242

4343
instance Applicative (Progress step fail) where
4444
pure a = Done a
45-
p <*> x = foldProgress Step Fail (flip fmap x) p
45+
p <*> x = foldProgress Step Fail (`fmap` x) p
4646

4747
instance Monoid fail => Alternative (Progress step fail) where
4848
empty = Fail mempty

cabal-install/src/Distribution/Client/CmdLegacy.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ legacyWrapperCmd ui commonFlags = toLegacyCmd (wrapperCmd ui commonFlags)
163163
newCmd :: CommandUI flags -> (flags -> [String] -> globals -> IO action) -> [CommandSpec (globals -> IO action)]
164164
newCmd origUi@CommandUI{..} action = [cmd defaultUi, cmd newUi, cmd origUi]
165165
where
166-
cmd ui = CommandSpec ui (flip commandAddAction action) NormalCommand
166+
cmd ui = CommandSpec ui (`commandAddAction` action) NormalCommand
167167

168168
newMsg = T.unpack . T.replace "v2-" "new-" . T.pack
169169
newUi =

cabal-install/src/Distribution/Client/CmdOutdated.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ type OutdatedDependency = OutdatedDependencyX Version
395395
-- | Convert a list of 'UserConstraint's to a 'Dependency' list.
396396
userConstraintsToDependencies :: [(UserConstraint, ConstraintSource)] -> [CandidateOutdatedDependency]
397397
userConstraintsToDependencies ucnstrs =
398-
mapMaybe (\(uc, src) -> fmap (flip mkCandidateOutdatedDependency (ConfigSource src)) (packageConstraintToDependency . userToPackageConstraint $ uc)) ucnstrs
398+
mapMaybe (\(uc, src) -> fmap (`mkCandidateOutdatedDependency` (ConfigSource src)) (packageConstraintToDependency . userToPackageConstraint $ uc)) ucnstrs
399399

400400
-- | Read the list of dependencies from the freeze file.
401401
depsFromFreezeFile :: Verbosity -> IO [CandidateOutdatedDependency]

cabal-install/src/Distribution/Client/InstallPlan.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -783,9 +783,9 @@ processingInvariant
783783
-> Bool
784784
processingInvariant plan (Processing processingSet completedSet failedSet) =
785785
-- All the packages in the three sets are actually in the graph
786-
assert (Foldable.all (flip Graph.member (planGraph plan)) processingSet)
787-
$ assert (Foldable.all (flip Graph.member (planGraph plan)) completedSet)
788-
$ assert (Foldable.all (flip Graph.member (planGraph plan)) failedSet)
786+
assert (Foldable.all (`Graph.member` (planGraph plan)) processingSet)
787+
$ assert (Foldable.all (`Graph.member` (planGraph plan)) completedSet)
788+
$ assert (Foldable.all (`Graph.member` (planGraph plan)) failedSet)
789789
$
790790
-- The processing, completed and failed sets are disjoint from each other
791791
assert (noIntersection processingSet completedSet)
@@ -1070,7 +1070,7 @@ problems graph =
10701070
| pkg <- Foldable.toList graph
10711071
, Just pkg' <-
10721072
map
1073-
(flip Graph.lookup graph)
1073+
(`Graph.lookup` graph)
10741074
(nodeNeighbors pkg)
10751075
, not (stateDependencyRelation pkg pkg')
10761076
]

0 commit comments

Comments
 (0)