Skip to content

Commit c4514ec

Browse files
author
Vladislav Sabanov
committed
Apply fourmolu
1 parent df57849 commit c4514ec

File tree

2 files changed

+64
-64
lines changed

2 files changed

+64
-64
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{-# LANGUAGE DataKinds #-}
2+
{-# LANGUAGE LambdaCase #-}
23
{-# LANGUAGE PatternSynonyms #-}
34
{-# LANGUAGE RecordWildCards #-}
4-
{-# LANGUAGE LambdaCase #-}
55

66
module Distribution.Client.CmdClean (cleanCommand, cleanAction) where
77

@@ -13,8 +13,8 @@ import Distribution.Client.Config
1313
)
1414
import Distribution.Client.DistDirLayout
1515
( DistDirLayout (..)
16-
, defaultDistDirLayout
1716
, ProjectRoot (ProjectRootImplicit)
17+
, defaultDistDirLayout
1818
, defaultProjectFile
1919
)
2020
import Distribution.Client.Errors
@@ -221,7 +221,7 @@ cleanAction (ProjectFlags{..}, CleanFlags{..}) extraArgs _ = do
221221
removeDirectoryRecursive cache
222222

223223
isValidProjectRoot :: ProjectRoot -> IO Bool
224-
isValidProjectRoot = \case
224+
isValidProjectRoot = \case
225225
(ProjectRootImplicit dir) -> do
226226
let projectFile = dir </> defaultProjectFile
227227
projectExists <- doesFileExist projectFile

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

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -568,14 +568,14 @@ exceptionMessageCabalInstall e = case e of
568568
PackageNameAmbiguousErr ambiguities ->
569569
unlines
570570
[ "There is no package named '"
571-
++ prettyShow name
572-
++ "'. "
573-
++ ( if length matches > 1
574-
then "However, the following package names exist: "
575-
else "However, the following package name exists: "
576-
)
577-
++ intercalate ", " ["'" ++ prettyShow m ++ "'" | m <- matches]
578-
++ "."
571+
++ prettyShow name
572+
++ "'. "
573+
++ ( if length matches > 1
574+
then "However, the following package names exist: "
575+
else "However, the following package name exists: "
576+
)
577+
++ intercalate ", " ["'" ++ prettyShow m ++ "'" | m <- matches]
578+
++ "."
579579
| (name, matches) <- ambiguities
580580
]
581581
ExtractTarballPackageErr err -> err
@@ -669,49 +669,49 @@ exceptionMessageCabalInstall e = case e of
669669
UnrecognisedTarget targets ->
670670
unlines
671671
[ "Unrecognised target '"
672-
++ target
673-
++ "'.\n"
674-
++ "Expected a "
675-
++ intercalate " or " expected
676-
++ ", rather than '"
677-
++ got
678-
++ "'."
672+
++ target
673+
++ "'.\n"
674+
++ "Expected a "
675+
++ intercalate " or " expected
676+
++ ", rather than '"
677+
++ got
678+
++ "'."
679679
| (target, expected, got) <- targets
680680
]
681681
NoSuchTargetSelectorErr targets ->
682682
unlines
683683
[ "Unknown target '"
684-
++ target
685-
++ "'.\n"
686-
++ unlines
687-
[ ( case inside of
688-
Just (kind, "") ->
689-
"The " ++ kind ++ " has no "
690-
Just (kind, thing) ->
691-
"The " ++ kind ++ " " ++ thing ++ " has no "
692-
Nothing -> "There is no "
693-
)
694-
++ intercalate
695-
" or "
696-
[ mungeThing thing ++ " '" ++ got ++ "'"
697-
| (thing, got, _alts) <- nosuch'
698-
]
699-
++ "."
700-
++ if null alternatives
701-
then ""
702-
else
703-
"\nPerhaps you meant "
704-
++ intercalate
705-
";\nor "
706-
[ "the " ++ thing ++ " '" ++ intercalate "' or '" alts ++ "'?"
707-
| (thing, alts) <- alternatives
708-
]
709-
| (inside, nosuch') <- groupByContainer nosuch
710-
, let alternatives =
711-
[ (thing, alts)
712-
| (thing, _got, alts@(_ : _)) <- nosuch'
684+
++ target
685+
++ "'.\n"
686+
++ unlines
687+
[ ( case inside of
688+
Just (kind, "") ->
689+
"The " ++ kind ++ " has no "
690+
Just (kind, thing) ->
691+
"The " ++ kind ++ " " ++ thing ++ " has no "
692+
Nothing -> "There is no "
693+
)
694+
++ intercalate
695+
" or "
696+
[ mungeThing thing ++ " '" ++ got ++ "'"
697+
| (thing, got, _alts) <- nosuch'
713698
]
714-
]
699+
++ "."
700+
++ if null alternatives
701+
then ""
702+
else
703+
"\nPerhaps you meant "
704+
++ intercalate
705+
";\nor "
706+
[ "the " ++ thing ++ " '" ++ intercalate "' or '" alts ++ "'?"
707+
| (thing, alts) <- alternatives
708+
]
709+
| (inside, nosuch') <- groupByContainer nosuch
710+
, let alternatives =
711+
[ (thing, alts)
712+
| (thing, _got, alts@(_ : _)) <- nosuch'
713+
]
714+
]
715715
| (target, nosuch) <- targets
716716
, let groupByContainer =
717717
map
@@ -731,16 +731,16 @@ exceptionMessageCabalInstall e = case e of
731731
TargetSelectorAmbiguousErr targets ->
732732
unlines
733733
[ "Ambiguous target '"
734-
++ target
735-
++ "'. It could be:\n "
736-
++ unlines
737-
[ " "
738-
++ ut
739-
++ " ("
740-
++ bt
741-
++ ")"
742-
| (ut, bt) <- amb
743-
]
734+
++ target
735+
++ "'. It could be:\n "
736+
++ unlines
737+
[ " "
738+
++ ut
739+
++ " ("
740+
++ bt
741+
++ ")"
742+
| (ut, bt) <- amb
743+
]
744744
| (target, amb) <- targets
745745
]
746746
TargetSelectorNoCurrentPackageErr target ->
@@ -787,11 +787,11 @@ exceptionMessageCabalInstall e = case e of
787787
++ "be unambiguous but matches the following targets:\n"
788788
++ unlines
789789
[ "'"
790-
++ rendering
791-
++ "', matching:"
792-
++ concatMap
793-
("\n - " ++)
794-
matches
790+
++ rendering
791+
++ "', matching:"
792+
++ concatMap
793+
("\n - " ++)
794+
matches
795795
| (rendering, matches) <- renderingsAndMatches
796796
]
797797
++ "\nNote: Cabal expects to be able to make a single fully "
@@ -887,7 +887,7 @@ exceptionMessageCabalInstall e = case e of
887887
renderCabalFileParseError cbfError
888888
ProjectConfigParseFailure pcfError ->
889889
renderProjectConfigParseError pcfError
890-
CleanActionNotPackage ->
890+
CleanActionNotPackage ->
891891
"Not a cabal project or package directory; skipping project cleanup."
892892

893893
instance Exception (VerboseException CabalInstallException) where

0 commit comments

Comments
 (0)