diff --git a/src/Stack/Config.hs b/src/Stack/Config.hs index 02c2bed826..0d2d19d28b 100644 --- a/src/Stack/Config.hs +++ b/src/Stack/Config.hs @@ -670,7 +670,7 @@ getLocalPackages = do $ C.package $ C.packageDescription gpd in (name, (gpd, loc)) - deps <- (map wrapGPD . concat) + deps <- map wrapGPD . concat <$> mapM (parseMultiCabalFilesIndex root) (bcDependencies bc) checkDuplicateNames $ diff --git a/src/Stack/Docker.hs b/src/Stack/Docker.hs index c119bff9f3..c58eebd875 100644 --- a/src/Stack/Docker.hs +++ b/src/Stack/Docker.hs @@ -310,7 +310,7 @@ runContainerAndExit getCmdArgs (Files.createSymbolicLink (toFilePathNoTrailingSep sshDir) (toFilePathNoTrailingSep (sandboxHomeDir sshRelDir)))) - containerID <- withWorkingDir projectRoot $ (trim . decodeUtf8) <$> readDockerProcess + containerID <- withWorkingDir projectRoot $ trim . decodeUtf8 <$> readDockerProcess (concat [["create" ,"--net=host" diff --git a/src/Stack/Ghci/Script.hs b/src/Stack/Ghci/Script.hs index 66ff303dce..984a90c66a 100644 --- a/src/Stack/Ghci/Script.hs +++ b/src/Stack/Ghci/Script.hs @@ -87,7 +87,7 @@ commandToBuilder (Module modules) | otherwise = fromText ":module + " <> mconcat (intersperse (fromText " ") - $ (stringUtf8 . quoteFileName . mconcat . intersperse "." . components) <$> S.toAscList modules) + $ stringUtf8 . quoteFileName . mconcat . intersperse "." . components <$> S.toAscList modules) <> fromText "\n" -- | Make sure that a filename with spaces in it gets the proper quotes. diff --git a/src/Stack/Init.hs b/src/Stack/Init.hs index ce25891a0e..271c03ecda 100644 --- a/src/Stack/Init.hs +++ b/src/Stack/Init.hs @@ -72,7 +72,7 @@ initProject whichCmd currDir initOpts mresolver = do find = findCabalDirs (includeSubDirs initOpts) dirs' = if null dirs then [currDir] else dirs logInfo "Looking for .cabal or package.yaml files to use to init the project." - cabaldirs <- (Set.toList . Set.unions) <$> mapM find dirs' + cabaldirs <- Set.toList . Set.unions <$> mapM find dirs' (bundle, dupPkgs) <- cabalPackagesCheck cabaldirs noPkgMsg Nothing (sd, flags, extraDeps, rbundle) <- getDefaultResolver whichCmd dest initOpts diff --git a/src/Stack/Options/DockerParser.hs b/src/Stack/Options/DockerParser.hs index 694aa1d024..0477621b30 100644 --- a/src/Stack/Options/DockerParser.hs +++ b/src/Stack/Options/DockerParser.hs @@ -25,11 +25,11 @@ dockerOptsParser hide0 = "using a Docker container. --docker implies 'system-ghc: true'" hide <*> fmap First - ((Just . DockerMonoidRepo) <$> option str (long (dockerOptName dockerRepoArgName) <> + (Just . DockerMonoidRepo <$> option str (long (dockerOptName dockerRepoArgName) <> hide <> metavar "NAME" <> help "Docker repository name") <|> - (Just . DockerMonoidImage) <$> option str (long (dockerOptName dockerImageArgName) <> + Just . DockerMonoidImage <$> option str (long (dockerOptName dockerImageArgName) <> hide <> metavar "IMAGE" <> help "Exact Docker image ID (overrides docker-repo)") <|> diff --git a/src/Stack/PackageLocation.hs b/src/Stack/PackageLocation.hs index 954e6baaa9..e3f1fd6b9d 100644 --- a/src/Stack/PackageLocation.hs +++ b/src/Stack/PackageLocation.hs @@ -279,7 +279,7 @@ parseMultiCabalFilesIndex -> PackageLocationIndex Subdirs -> RIO env [(GenericPackageDescription, PackageLocationIndex FilePath)] parseMultiCabalFilesIndex _root (PLIndex pir) = - (pure . (, PLIndex pir)) <$> + pure . (, PLIndex pir) <$> readPackageUnresolvedIndex pir parseMultiCabalFilesIndex root (PLOther loc0) = map (\lpv -> (lpvGPD lpv, PLOther $ lpvLoc lpv)) <$> diff --git a/src/Stack/Runners.hs b/src/Stack/Runners.hs index 4afbe4f573..54f0502d64 100644 --- a/src/Stack/Runners.hs +++ b/src/Stack/Runners.hs @@ -229,7 +229,7 @@ withMiniConfigAndLock withMiniConfigAndLock go@GlobalOpts{..} inner = withRunnerGlobal go $ \runner -> do miniConfig <- runRIO runner $ - (loadMiniConfig . lcConfig) <$> + loadMiniConfig . lcConfig <$> loadConfigMaybeProject globalConfigMonoid globalResolver diff --git a/src/Stack/Snapshot.hs b/src/Stack/Snapshot.hs index a8bd958322..fd0183171f 100644 --- a/src/Stack/Snapshot.hs +++ b/src/Stack/Snapshot.hs @@ -276,7 +276,7 @@ loadResolver (ResolverCustom url loc) = do mdir <- case loc of Left _ -> return Nothing - Right fp' -> (Just . parent) <$> liftIO (Dir.canonicalizePath fp' >>= parseAbsFile) + Right fp' -> Just . parent <$> liftIO (Dir.canonicalizePath fp' >>= parseAbsFile) -- Deal with the dual nature of the compiler key, which either -- means "use this compiler" or "override the compiler in the diff --git a/src/Stack/Solver.hs b/src/Stack/Solver.hs index 75ecc0606e..c6c410ad63 100644 --- a/src/Stack/Solver.hs +++ b/src/Stack/Solver.hs @@ -503,7 +503,7 @@ findCabalDirs :: HasConfig env => Bool -> Path Abs Dir -> RIO env (Set (Path Abs Dir)) findCabalDirs recurse dir = - (Set.fromList . map parent) + Set.fromList . map parent <$> liftIO (findFiles dir isHpackOrCabal subdirFilter) where subdirFilter subdir = recurse && not (isIgnored subdir) diff --git a/src/Stack/Types/BuildPlan.hs b/src/Stack/Types/BuildPlan.hs index 97d5faf955..e55c81d55f 100644 --- a/src/Stack/Types/BuildPlan.hs +++ b/src/Stack/Types/BuildPlan.hs @@ -229,7 +229,7 @@ instance subdirs ~ Subdirs => ToJSON (PackageLocation subdirs) where instance subdirs ~ Subdirs => FromJSON (WithJSONWarnings (PackageLocationIndex subdirs)) where parseJSON v - = ((noJSONWarnings . PLIndex) <$> parseJSON v) + = (noJSONWarnings . PLIndex <$> parseJSON v) <|> (fmap PLOther <$> parseJSON v) instance subdirs ~ Subdirs => FromJSON (WithJSONWarnings (PackageLocation subdirs)) where diff --git a/src/Stack/Types/Docker.hs b/src/Stack/Types/Docker.hs index 8979ff8912..5ed60925ea 100644 --- a/src/Stack/Types/Docker.hs +++ b/src/Stack/Types/Docker.hs @@ -109,8 +109,8 @@ instance FromJSON (WithJSONWarnings DockerOptsMonoid) where (\o -> do dockerMonoidDefaultEnable <- pure (Any True) dockerMonoidEnable <- First <$> o ..:? dockerEnableArgName dockerMonoidRepoOrImage <- First <$> - (((Just . DockerMonoidImage) <$> o ..: dockerImageArgName) <|> - ((Just . DockerMonoidRepo) <$> o ..: dockerRepoArgName) <|> + ((Just . DockerMonoidImage <$> o ..: dockerImageArgName) <|> + (Just . DockerMonoidRepo <$> o ..: dockerRepoArgName) <|> pure Nothing) dockerMonoidRegistryLogin <- First <$> o ..:? dockerRegistryLoginArgName dockerMonoidRegistryUsername <- First <$> o ..:? dockerRegistryUsernameArgName