@@ -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- " \n Perhaps you meant "
704- ++ intercalate
705- " ;\n or "
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+ " \n Perhaps you meant "
704+ ++ intercalate
705+ " ;\n or "
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 ++ " \n Note: 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
893893instance Exception (VerboseException CabalInstallException ) where
0 commit comments