Skip to content

Commit b04139c

Browse files
authored
Merge of #11676
2 parents 8974189 + e6c58c0 commit b04139c

File tree

21 files changed

+25
-26
lines changed

21 files changed

+25
-26
lines changed

.hlint.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Warnings currently triggered by your code
22
- ignore: {name: "Avoid NonEmpty.unzip"} # 1 hint
33
- ignore: {name: "Avoid lambda"} # 51 hints
4-
- ignore: {name: "Avoid lambda using `infix`"} # 23 hints
54
- ignore: {name: "Eta reduce"} # 138 hints
65
- ignore: {name: "Hoist not"} # 16 hints
76
- ignore: {name: "Move filter"} # 4 hints

Cabal-syntax/src/Distribution/Compat/CharParsing.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ import Distribution.Compat.Parsing
7373
--
7474
-- > vowel = oneOf "aeiou"
7575
oneOf :: CharParsing m => [Char] -> m Char
76-
oneOf xs = satisfy (\c -> c `elem` xs)
76+
oneOf xs = satisfy (`elem` xs)
7777
{-# INLINE oneOf #-}
7878

7979
-- | As the dual of 'oneOf', @noneOf cs@ succeeds if the current
@@ -82,7 +82,7 @@ oneOf xs = satisfy (\c -> c `elem` xs)
8282
--
8383
-- > consonant = noneOf "aeiou"
8484
noneOf :: CharParsing m => [Char] -> m Char
85-
noneOf xs = satisfy (\c -> c `notElem` xs)
85+
noneOf xs = satisfy (`notElem` xs)
8686
{-# INLINE noneOf #-}
8787

8888
-- | Skips /zero/ or more white space characters. See also 'skipMany'.

Cabal-syntax/src/Distribution/PackageDescription/FieldGrammar.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,8 @@ profSharedOptionsFieldGrammar =
758758

759759
lookupLens :: (Functor f, Monoid v) => CompilerFlavor -> LensLike' f (PerCompilerFlavor v) v
760760
lookupLens k f p@(PerCompilerFlavor ghc ghcjs)
761-
| k == GHC = (\n -> PerCompilerFlavor n ghcjs) <$> f ghc
762-
| k == GHCJS = (\n -> PerCompilerFlavor ghc n) <$> f ghcjs
761+
| k == GHC = (`PerCompilerFlavor` ghcjs) <$> f ghc
762+
| k == GHCJS = (ghc `PerCompilerFlavor`) <$> f ghcjs
763763
| otherwise = p <$ f mempty
764764

765765
-------------------------------------------------------------------------------

Cabal-syntax/src/Distribution/PackageDescription/Parsec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ data SectionS = SectionS
133133
}
134134

135135
stateGpd :: Lens' SectionS GenericPackageDescription
136-
stateGpd f (SectionS gpd cs) = (\x -> SectionS x cs) <$> f gpd
136+
stateGpd f (SectionS gpd cs) = (`SectionS` cs) <$> f gpd
137137
{-# INLINE stateGpd #-}
138138

139139
stateCommonStanzas :: Lens' SectionS (Map String CondTreeBuildInfo)

Cabal-syntax/src/Distribution/Parsec/FieldLineStream.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ instance Monad m => Parsec.Stream FieldLineStream m Char where
4545
uncons (FLSCons bs s) = return $ case BS.uncons bs of
4646
-- as lines are glued with '\n', we return '\n' here!
4747
Nothing -> Just ('\n', s)
48-
Just (c, bs') -> Just (unconsChar c bs' (\bs'' -> FLSCons bs'' s) s)
48+
Just (c, bs') -> Just (unconsChar c bs' (`FLSCons` s) s)
4949

5050
unconsChar :: forall a. Word8 -> ByteString -> (ByteString -> a) -> a -> (Char, a)
5151
unconsChar c0 bs0 f next = go (utf8DecodeStart c0) bs0

Cabal-syntax/src/Distribution/Types/ModuleRenaming.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ interpModuleRenaming :: ModuleRenaming -> ModuleName -> Maybe ModuleName
4949
interpModuleRenaming DefaultRenaming = Just
5050
interpModuleRenaming (ModuleRenaming rns) =
5151
let m = Map.fromList rns
52-
in \k -> Map.lookup k m
52+
in (`Map.lookup` m)
5353
interpModuleRenaming (HidingRenaming hs) =
5454
let s = Set.fromList hs
5555
in \k -> if k `Set.member` s then Nothing else Just k

Cabal-tests/tests/UnitTests/Distribution/Simple/Command.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ argumentTests =
3030
cmdUI = CommandUI
3131
{ commandName = "cmd"
3232
, commandSynopsis = "the command"
33-
, commandUsage = \name -> name ++ " cmd -v[N]"
33+
, commandUsage = (++ " cmd -v[N]")
3434
, commandDescription = Nothing
3535
, commandNotes = Nothing
3636
, commandDefaultFlags = Flag.NoFlag

Cabal/src/Distribution/Backpack/LinkedComponent.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ toLinkedComponent
381381
, lc_component = component
382382
, lc_public = is_public
383383
, -- These must be executables
384-
lc_exe_deps = map (fmap (\cid -> IndefFullUnitId cid Map.empty)) exe_deps
384+
lc_exe_deps = map (fmap (`IndefFullUnitId` Map.empty)) exe_deps
385385
, lc_shape = final_linked_shape
386386
, lc_includes = linked_includes
387387
, lc_sig_includes = linked_sig_includes

Cabal/src/Distribution/Simple/Register.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi
527527
expectLibraryComponent (maybeComponentExposedModules clbi)
528528
-- add virtual modules into the list of exposed modules for the
529529
-- package database as well.
530-
++ map (\name -> IPI.ExposedModule name Nothing) (virtualModules bi)
530+
++ map (`IPI.ExposedModule` Nothing) (virtualModules bi)
531531
, IPI.hiddenModules = otherModules bi
532532
, IPI.trusted = IPI.trusted IPI.emptyInstalledPackageInfo
533533
, IPI.importDirs = [libdir installDirs | hasModules]

Cabal/src/Distribution/Utils/MapAccum.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ mapAccumM
2424
-> a
2525
-> t b
2626
-> m (a, t c)
27-
mapAccumM f s t = runStateM (traverse (\x -> StateM (\s' -> f s' x)) t) s
27+
mapAccumM f s t = runStateM (traverse (\x -> StateM (`f` x)) t) s

0 commit comments

Comments
 (0)