    -----------------------------------------------------------------------------

    -- Module      :  Distribution.Simple.Errors
    -- Copyright   :  Suganya Arun
    -- License     :  BSD3
    -- Maintainer  :  cabal-devel@haskell.org
    -- Portability :  portable
    --
    -- A collection of Exception Types in the Cabal library package

    module Distribution.Simple.Errors
      ( CabalException (..)
      , FailedDependency (..)
      , exceptionCode
      , exceptionMessage
      ) where

    import Distribution.Compat.Prelude
    import Distribution.Compiler
    import Distribution.InstalledPackageInfo
    import Distribution.ModuleName
    import Distribution.Package
    import Distribution.PackageDescription
    import Distribution.Pretty
      ( Pretty (pretty)
      , prettyShow
      )
    import Distribution.Simple.InstallDirs
    import Distribution.Simple.PreProcess.Types (Suffix)
    import Distribution.Simple.SetupHooks.Errors
    import Distribution.System (OS)
    import Distribution.Types.MissingDependency (MissingDependency)
    import Distribution.Types.VersionRange.Internal ()
    import Distribution.Version
    import Text.PrettyPrint

    data FailedDependency
      = DependencyNotExists PackageName
      | DependencyMissingInternal PackageName LibraryName
      | DependencyNoVersion Dependency
      deriving (Int -> FailedDependency -> ShowS
    [FailedDependency] -> ShowS
    FailedDependency -> [Char]
    (Int -> FailedDependency -> ShowS)
    -> (FailedDependency -> [Char])
    -> ([FailedDependency] -> ShowS)
    -> Show FailedDependency
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> FailedDependency -> ShowS
    showsPrec :: Int -> FailedDependency -> ShowS
    $cshow :: FailedDependency -> [Char]
    show :: FailedDependency -> [Char]
    $cshowList :: [FailedDependency] -> ShowS
    showList :: [FailedDependency] -> ShowS
    Show)

    -- Types representing exceptions thrown by functions in all the modules of Cabal Package
    data CabalException
      = NoBenchMarkProgram FilePath
      | EnableBenchMark
      | BenchMarkNameDisabled String
      | NoBenchMark String
      | -- | @NoLibraryFound@ has been downgraded to a warning, and is therefore no longer emitted.
        NoLibraryFound
      | CompilerNotInstalled CompilerFlavor
      | CantFindIncludeFile String
      | UnsupportedTestSuite String
      | UnsupportedBenchMark String
      | NoIncludeFileFound String
      | NoModuleFound ModuleName [Suffix]
      | RegMultipleInstancePkg
      | SuppressingChecksOnFile
      | NoSupportDirStylePackageDb
      | OnlySupportSpecificPackageDb
      | FailedToParseOutputDescribe String PackageId
      | DumpFailed String String
      | FailedToParseOutputDump String
      | ListFailed String
      | FailedToParseOutputList String
      | ProgramNotFound String
      | NoSupportForHoogle
      | NoSupportForQuickJumpFlag
      | NoGHCVersionFromHaddock
      | NoGHCVersionFromCompiler
      | HaddockAndGHCVersionDoesntMatch Version Version
      | MustHaveSharedLibraries
      | HaddockPackageFlags [(InstalledPackageInfo, [UnitId])]
      | UnknownCompilerFlavor CompilerFlavor
      | FailedToDetermineTarget
      | NoMultipleTargets
      | REPLNotSupported
      | NoSupportBuildingTestSuite TestType
      | NoSupportBuildingBenchMark BenchmarkType
      | BuildingNotSupportedWithCompiler
      | PkgDumpFailed
      | FailedToParseOutput
      | CantFindSourceModule ModuleName
      | VersionMismatchJS FilePath Version FilePath Version
      | VersionMismatchGHCJS FilePath Version FilePath Version
      | GlobalPackageDBLimitation
      | GlobalPackageDBSpecifiedFirst
      | MatchDirFileGlob String
      | MatchDirFileGlobErrors [String]
      | ErrorParsingFileDoesntExist FilePath
      | FailedParsing String
      | NotFoundMsg
      | UnrecognisedBuildTarget [String]
      | ReportBuildTargetProblems [(String, [String], String)]
      | UnknownBuildTarget [(String, [(String, String)])]
      | AmbiguousBuildTarget [(String, [(String, String)])]
      | CheckBuildTargets String
      | VersionMismatchGHC FilePath Version FilePath Version
      | CheckPackageDbStackPost76
      | CheckPackageDbStackPre76
      | GlobalPackageDbSpecifiedFirst
      | CantInstallForeignLib
      | NoSupportForPreProcessingTest TestType
      | NoSupportForPreProcessingBenchmark BenchmarkType
      | CantFindSourceForPreProcessFile String
      | NoSupportPreProcessingTestExtras TestType
      | NoSupportPreProcessingBenchmarkExtras BenchmarkType
      | UnlitException String
      | RunProgramInvocationException FilePath String
      | GetProgramInvocationException FilePath String
      | GetProgramInvocationLBSException FilePath String
      | CheckSemaphoreSupport
      | NoLibraryForPackage
      | SanityCheckHookedBuildInfo UnqualComponentName
      | ConfigureScriptNotFound FilePath
      | NoValidComponent
      | ConfigureEitherSingleOrAll
      | ConfigCIDValidForPreComponent
      | SanityCheckForEnableComponents
      | SanityCheckForDynamicStaticLinking
      | UnsupportedLanguages PackageIdentifier CompilerId [String]
      | UnsupportedLanguageExtension PackageIdentifier CompilerId [String]
      | CantFindForeignLibraries [String]
      | ExpectedAbsoluteDirectory FilePath
      | FlagsNotSpecified [FlagName]
      | EncounteredMissingDependency [MissingDependency]
      | CompilerDoesn'tSupportThinning
      | CompilerDoesn'tSupportReexports
      | CompilerDoesn'tSupportBackpack
      | LibraryWithinSamePackage [PackageId]
      | ReportFailedDependencies [FailedDependency] String
      | NoPackageDatabaseSpecified
      | HowToFindInstalledPackages CompilerFlavor
      | PkgConfigNotFound String String
      | BadVersion String String PkgconfigVersion
      | UnknownCompilerException
      | NoWorkingGcc
      | NoOSSupport OS String
      | NoCompilerSupport String
      | InstallDirsNotPrefixRelative (InstallDirs FilePath)
      | ExplainErrors (Maybe (Either [Char] [Char])) [String]
      | CheckPackageProblems [String]
      | LibDirDepsPrefixNotRelative FilePath FilePath
      | CombinedConstraints Doc
      | CantParseGHCOutput
      | IncompatibleWithCabal String String
      | Couldn'tFindTestProgram FilePath
      | TestCoverageSupport
      | Couldn'tFindTestProgLibV09 FilePath
      | TestCoverageSupportLibV09
      | RawSystemStdout String
      | FindFile FilePath
      | FindModuleFileEx ModuleName [Suffix] [FilePath]
      | MultipleFilesWithExtension String
      | NoDesc
      | MultiDesc [String]
      | RelocRegistrationInfo
      | CreatePackageDB
      | WithHcPkg String
      | RegisMultiplePkgNotSupported
      | RegisteringNotImplemented
      | NoTestSuitesEnabled
      | TestNameDisabled String
      | NoSuchTest String
      | ConfigureProgram String FilePath
      | RequireProgram String
      | NoProgramFound String VersionRange
      | BadVersionDb String Version VersionRange FilePath
      | UnknownVersionDb String VersionRange FilePath
      | MissingCoveredInstalledLibrary UnitId
      | SetupHooksException SetupHooksException
      | MultiReplDoesNotSupportComplexReexportedModules PackageName ComponentName
      deriving (Int -> CabalException -> ShowS
    [CabalException] -> ShowS
    CabalException -> [Char]
    (Int -> CabalException -> ShowS)
    -> (CabalException -> [Char])
    -> ([CabalException] -> ShowS)
    -> Show CabalException
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> CabalException -> ShowS
    showsPrec :: Int -> CabalException -> ShowS
    $cshow :: CabalException -> [Char]
    show :: CabalException -> [Char]
    $cshowList :: [CabalException] -> ShowS
    showList :: [CabalException] -> ShowS
    Show)

    exceptionCode :: CabalException -> Int
    exceptionCode :: CabalException -> Int
    exceptionCode CabalException
    e = case CabalException
    e of
      NoBenchMarkProgram{} -> Int
    1678
      EnableBenchMark{} -> Int
    1453
      BenchMarkNameDisabled{} -> Int
    2781
      NoBenchMark{} -> Int
    1654
      CabalException
    NoLibraryFound -> Int
    2546
      CompilerNotInstalled{} -> Int
    7465
      CantFindIncludeFile{} -> Int
    3876
      UnsupportedTestSuite{} -> Int
    3245
      UnsupportedBenchMark{} -> Int
    9123
      NoIncludeFileFound{} -> Int
    2987
      NoModuleFound{} -> Int
    6421
      RegMultipleInstancePkg{} -> Int
    3421
      SuppressingChecksOnFile{} -> Int
    5436
      CabalException
    NoSupportDirStylePackageDb -> Int
    2980
      CabalException
    OnlySupportSpecificPackageDb -> Int
    6547
      FailedToParseOutputDescribe{} -> Int
    7218
      DumpFailed{} -> Int
    6736
      FailedToParseOutputDump{} -> Int
    9076
      ListFailed{} -> Int
    5109
      FailedToParseOutputList{} -> Int
    7650
      ProgramNotFound{} -> Int
    4123
      NoSupportForHoogle{} -> Int
    8706
      NoSupportForQuickJumpFlag{} -> Int
    7086
      CabalException
    NoGHCVersionFromHaddock -> Int
    5045
      CabalException
    NoGHCVersionFromCompiler -> Int
    4098
      HaddockAndGHCVersionDoesntMatch{} -> Int
    1998
      MustHaveSharedLibraries{} -> Int
    6032
      HaddockPackageFlags{} -> Int
    4569
      UnknownCompilerFlavor{} -> Int
    3102
      FailedToDetermineTarget{} -> Int
    5049
      NoMultipleTargets{} -> Int
    6091
      REPLNotSupported{} -> Int
    1098
      NoSupportBuildingTestSuite{} -> Int
    4106
      NoSupportBuildingBenchMark{} -> Int
    5320
      BuildingNotSupportedWithCompiler{} -> Int
    7077
      -- Retired: ProvideHaskellSuiteTool{} -> 7509
      -- Retired: CannotDetermineCompilerVersion{} -> 4519
      PkgDumpFailed{} -> Int
    2291
      FailedToParseOutput{} -> Int
    5500
      CantFindSourceModule{} -> Int
    8870
      VersionMismatchJS{} -> Int
    9001
      VersionMismatchGHCJS{} -> Int
    4001
      GlobalPackageDBLimitation{} -> Int
    5002
      GlobalPackageDBSpecifiedFirst{} -> Int
    3901
      MatchDirFileGlob{} -> Int
    9760
      MatchDirFileGlobErrors{} -> Int
    6661
      ErrorParsingFileDoesntExist{} -> Int
    1234
      FailedParsing{} -> Int
    6565
      NotFoundMsg{} -> Int
    8011
      UnrecognisedBuildTarget{} -> Int
    3410
      ReportBuildTargetProblems{} -> Int
    5504
      UnknownBuildTarget{} -> Int
    4444
      AmbiguousBuildTarget{} -> Int
    7865
      CheckBuildTargets{} -> Int
    4733
      VersionMismatchGHC{} -> Int
    4000
      CheckPackageDbStackPost76{} -> Int
    3000
      CheckPackageDbStackPre76{} -> Int
    5640
      GlobalPackageDbSpecifiedFirst{} -> Int
    2345
      CantInstallForeignLib{} -> Int
    8221
      NoSupportForPreProcessingTest{} -> Int
    3008
      NoSupportForPreProcessingBenchmark{} -> Int
    6990
      CantFindSourceForPreProcessFile{} -> Int
    7554
      NoSupportPreProcessingTestExtras{} -> Int
    7886
      NoSupportPreProcessingBenchmarkExtras{} -> Int
    9999
      UnlitException{} -> Int
    5454
      RunProgramInvocationException{} -> Int
    8012
      GetProgramInvocationException{} -> Int
    7300
      GetProgramInvocationLBSException{} -> Int
    6578
      CheckSemaphoreSupport{} -> Int
    2002
      NoLibraryForPackage{} -> Int
    8004
      SanityCheckHookedBuildInfo{} -> Int
    6007
      ConfigureScriptNotFound{} -> Int
    4567
      NoValidComponent{} -> Int
    5680
      ConfigureEitherSingleOrAll{} -> Int
    2001
      ConfigCIDValidForPreComponent{} -> Int
    7006
      SanityCheckForEnableComponents{} -> Int
    5004
      SanityCheckForDynamicStaticLinking{} -> Int
    4007
      UnsupportedLanguages{} -> Int
    8074
      UnsupportedLanguageExtension{} -> Int
    5656
      CantFindForeignLibraries{} -> Int
    4574
      ExpectedAbsoluteDirectory{} -> Int
    6662
      FlagsNotSpecified{} -> Int
    9080
      EncounteredMissingDependency{} -> Int
    8010
      CompilerDoesn'tSupportThinning{} -> Int
    4003
      CompilerDoesn'tSupportReexports{} -> Int
    3456
      CompilerDoesn'tSupportBackpack{} -> Int
    5446
      LibraryWithinSamePackage{} -> Int
    7007
      ReportFailedDependencies{} -> Int
    4321
      NoPackageDatabaseSpecified{} -> Int
    2300
      HowToFindInstalledPackages{} -> Int
    3003
      PkgConfigNotFound{} -> Int
    7123
      BadVersion{} -> Int
    7600
      UnknownCompilerException{} -> Int
    3022
      NoWorkingGcc{} -> Int
    1088
      NoOSSupport{} -> Int
    3339
      NoCompilerSupport{} -> Int
    2290
      InstallDirsNotPrefixRelative{} -> Int
    6000
      ExplainErrors{} -> Int
    4345
      CheckPackageProblems{} -> Int
    5559
      LibDirDepsPrefixNotRelative{} -> Int
    6667
      CombinedConstraints{} -> Int
    5000
      CantParseGHCOutput{} -> Int
    1980
      IncompatibleWithCabal{} -> Int
    8123
      Couldn'tFindTestProgram{} -> Int
    5678
      TestCoverageSupport{} -> Int
    7890
      Couldn'tFindTestProgLibV09{} -> Int
    9012
      TestCoverageSupportLibV09{} -> Int
    1076
      RawSystemStdout{} -> Int
    3098
      FindFile{} -> Int
    2115
      FindModuleFileEx{} -> Int
    6663
      MultipleFilesWithExtension{} -> Int
    3333
      NoDesc{} -> Int
    7654
      MultiDesc{} -> Int
    5554
      RelocRegistrationInfo{} -> Int
    4343
      CreatePackageDB{} -> Int
    6787
      WithHcPkg{} -> Int
    9876
      RegisMultiplePkgNotSupported{} -> Int
    7632
      RegisteringNotImplemented{} -> Int
    5411
      NoTestSuitesEnabled{} -> Int
    9061
      TestNameDisabled{} -> Int
    8210
      NoSuchTest{} -> Int
    8000
      ConfigureProgram{} -> Int
    5490
      RequireProgram{} -> Int
    6666
      NoProgramFound{} -> Int
    7620
      BadVersionDb{} -> Int
    8038
      UnknownVersionDb{} -> Int
    1008
      MissingCoveredInstalledLibrary{} -> Int
    9341
      SetupHooksException SetupHooksException
    err ->
        SetupHooksException -> Int
    setupHooksExceptionCode SetupHooksException
    err
      MultiReplDoesNotSupportComplexReexportedModules{} -> Int
    9355

    versionRequirement :: VersionRange -> String
    versionRequirement :: VersionRange -> [Char]
    versionRequirement VersionRange
    range
      | VersionRange -> Bool
    isAnyVersion VersionRange
    range = [Char]
    ""
      | Bool
    otherwise = [Char]
    " version " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ VersionRange -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow VersionRange
    range

    exceptionMessage :: CabalException -> String
    exceptionMessage :: CabalException -> [Char]
    exceptionMessage CabalException
    e = case CabalException
    e of
      NoBenchMarkProgram [Char]
    cmd -> [Char]
    "Could not find benchmark program \"" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    cmd [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "\". Did you build the package first?"
      CabalException
    EnableBenchMark -> [Char]
    "No benchmarks enabled. Did you remember to \'Setup configure\' with " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "\'--enable-benchmarks\'?"
      BenchMarkNameDisabled [Char]
    bmName -> [Char]
    "Package configured with benchmark " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    bmName [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " disabled."
      NoBenchMark [Char]
    bmName -> [Char]
    "no such benchmark: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    bmName
      CabalException
    NoLibraryFound -> [Char]
    "No executables and no library found. Nothing to do."
      CompilerNotInstalled CompilerFlavor
    compilerFlavor -> [Char]
    "installing with " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ CompilerFlavor -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow CompilerFlavor
    compilerFlavor [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "is not implemented"
      CantFindIncludeFile [Char]
    file -> [Char]
    "can't find include file " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    file
      UnsupportedTestSuite [Char]
    test_type -> [Char]
    "Unsupported test suite type: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    test_type
      UnsupportedBenchMark [Char]
    benchMarkType -> [Char]
    "Unsupported benchmark type: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    benchMarkType
      NoIncludeFileFound [Char]
    f -> [Char]
    "can't find include file " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    f
      NoModuleFound ModuleName
    m [Suffix]
    suffixes ->
        [Char]
    "Could not find module: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ ModuleName -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow ModuleName
    m
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " with any suffix: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [[Char]] -> [Char]
    forall a. Show a => a -> [Char]
    show ((Suffix -> [Char]) -> [Suffix] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    map Suffix -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow [Suffix]
    suffixes)
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    ".\n"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "If the module "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "is autogenerated it should be added to 'autogen-modules'."
      CabalException
    RegMultipleInstancePkg -> [Char]
    "HcPkg.register: the compiler does not support registering multiple instances of packages."
      CabalException
    SuppressingChecksOnFile -> [Char]
    "HcPkg.register: the compiler does not support suppressing checks on files."
      CabalException
    NoSupportDirStylePackageDb -> [Char]
    "HcPkg.writeRegistrationFileDirectly: compiler does not support dir style package dbs"
      CabalException
    OnlySupportSpecificPackageDb -> [Char]
    "HcPkg.writeRegistrationFileDirectly: only supports SpecificPackageDB for now"
      FailedToParseOutputDescribe [Char]
    programId PackageIdentifier
    pkgId -> [Char]
    "failed to parse output of '" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    programId [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " describe " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ PackageIdentifier -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow PackageIdentifier
    pkgId [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "'"
      DumpFailed [Char]
    programId [Char]
    exception -> [Char]
    programId [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " dump failed: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    exception
      FailedToParseOutputDump [Char]
    programId -> [Char]
    "failed to parse output of '" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    programId [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " dump'"
      ListFailed [Char]
    programId -> [Char]
    programId [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " list failed"
      FailedToParseOutputList [Char]
    programId -> [Char]
    "failed to parse output of '" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    programId [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " list'"
      ProgramNotFound [Char]
    progName -> [Char]
    "The program '" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    progName [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "' is required but it could not be found"
      CabalException
    NoSupportForHoogle -> [Char]
    "Haddock 2.0 and 2.1 do not support the --hoogle flag."
      CabalException
    NoSupportForQuickJumpFlag -> [Char]
    "Haddock prior to 2.19 does not support the --quickjump flag."
      CabalException
    NoGHCVersionFromHaddock -> [Char]
    "Could not get GHC version from Haddock"
      CabalException
    NoGHCVersionFromCompiler -> [Char]
    "Could not get GHC version from compiler"
      HaddockAndGHCVersionDoesntMatch Version
    ghcVersion Version
    haddockGhcVersion ->
        [Char]
    "Haddock's internal GHC version must match the configured "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "GHC version.\n"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "The GHC version is "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Version -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow Version
    ghcVersion
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " but "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "haddock is using GHC version "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Version -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow Version
    haddockGhcVersion
      CabalException
    MustHaveSharedLibraries -> [Char]
    "Must have vanilla or shared libraries enabled in order to run haddock"
      HaddockPackageFlags [(InstalledPackageInfo, [UnitId])]
    inf ->
        [Char]
    "internal error when calculating transitive "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "package dependencies.\nDebug info: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [(InstalledPackageInfo, [UnitId])] -> [Char]
    forall a. Show a => a -> [Char]
    show [(InstalledPackageInfo, [UnitId])]
    inf
      UnknownCompilerFlavor CompilerFlavor
    compilerFlavor -> [Char]
    "dumpBuildInfo: Unknown compiler flavor: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ CompilerFlavor -> [Char]
    forall a. Show a => a -> [Char]
    show CompilerFlavor
    compilerFlavor
      CabalException
    FailedToDetermineTarget -> [Char]
    "Failed to determine target."
      CabalException
    NoMultipleTargets -> [Char]
    "The 'repl' command does not support multiple targets at once."
      CabalException
    REPLNotSupported -> [Char]
    "A REPL is not supported with this compiler."
      NoSupportBuildingTestSuite TestType
    test_type -> [Char]
    "No support for building test suite type " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ TestType -> [Char]
    forall a. Show a => a -> [Char]
    show TestType
    test_type
      NoSupportBuildingBenchMark BenchmarkType
    benchMarkType -> [Char]
    "No support for building benchmark type " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ BenchmarkType -> [Char]
    forall a. Show a => a -> [Char]
    show BenchmarkType
    benchMarkType
      CabalException
    BuildingNotSupportedWithCompiler -> [Char]
    "Building is not supported with this compiler."
      CabalException
    PkgDumpFailed -> [Char]
    "pkg dump failed"
      CabalException
    FailedToParseOutput -> [Char]
    "failed to parse output of 'pkg dump'"
      CantFindSourceModule ModuleName
    moduleName -> [Char]
    "can't find source for module " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ ModuleName -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow ModuleName
    moduleName
      VersionMismatchJS [Char]
    ghcjsProgPath Version
    ghcjsVersion [Char]
    ghcjsPkgProgPath Version
    ghcjsPkgGhcjsVersion ->
        [Char]
    "Version mismatch between ghcjs and ghcjs-pkg: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ ShowS
    forall a. Show a => a -> [Char]
    show [Char]
    ghcjsProgPath
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " is version "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Version -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow Version
    ghcjsVersion
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ ShowS
    forall a. Show a => a -> [Char]
    show [Char]
    ghcjsPkgProgPath
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " is version "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Version -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow Version
    ghcjsPkgGhcjsVersion
      VersionMismatchGHCJS [Char]
    ghcjsProgPath Version
    ghcjsGhcVersion [Char]
    ghcjsPkgProgPath Version
    ghcjsPkgVersion ->
        [Char]
    "Version mismatch between ghcjs and ghcjs-pkg: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ ShowS
    forall a. Show a => a -> [Char]
    show [Char]
    ghcjsProgPath
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " was built with GHC version "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Version -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow Version
    ghcjsGhcVersion
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ ShowS
    forall a. Show a => a -> [Char]
    show [Char]
    ghcjsPkgProgPath
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " was built with GHC version "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Version -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow Version
    ghcjsPkgVersion
      CabalException
    GlobalPackageDBLimitation ->
        [Char]
    "With current ghc versions the global package db is always used "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "and must be listed first. This ghc limitation may be lifted in "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "the future, see https://gitlab.haskell.org/ghc/ghc/-/issues/5977"
      CabalException
    GlobalPackageDBSpecifiedFirst ->
        [Char]
    "If the global package db is specified, it must be "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "specified first and cannot be specified multiple times"
      MatchDirFileGlob [Char]
    pathError -> [Char]
    pathError
      MatchDirFileGlobErrors [[Char]]
    errors -> [[Char]] -> [Char]
    unlines [[Char]]
    errors
      ErrorParsingFileDoesntExist [Char]
    filePath -> [Char]
    "Error Parsing: file \"" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    filePath [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "\" doesn't exist. Cannot continue."
      FailedParsing [Char]
    name -> [Char]
    "Failed parsing \"" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    name [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "\"."
      CabalException
    NotFoundMsg ->
        [Char]
    "The package has a './configure' script. "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "If you are on Windows, This requires a "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "Unix compatibility toolchain such as MinGW+MSYS or Cygwin. "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "If you are not on Windows, ensure that an 'sh' command "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "is discoverable in your path."
      UnrecognisedBuildTarget [[Char]]
    target ->
        [[Char]] -> [Char]
    unlines
          [ [Char]
    "Unrecognised build target '" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    name [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "'."
          | [Char]
    name <- [[Char]]
    target
          ]
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "Examples:\n"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " - build foo          -- component name "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "(library, executable, test-suite or benchmark)\n"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " - build Data.Foo     -- module name\n"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " - build Data/Foo.hsc -- file name\n"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " - build lib:foo exe:foo   -- component qualified by kind\n"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " - build foo:Data.Foo      -- module qualified by component\n"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " - build foo:Data/Foo.hsc  -- file qualified by component"
      ReportBuildTargetProblems [([Char], [[Char]], [Char])]
    targets ->
        [[Char]] -> [Char]
    unlines
          [ [Char]
    "Unrecognised build target '"
            [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    target
            [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "'.\n"
            [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "Expected a "
            [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char] -> [[Char]] -> [Char]
    forall a. [a] -> [[a]] -> [a]
    intercalate [Char]
    " or " [[Char]]
    expected
            [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    ", rather than '"
            [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    got
            [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "'."
          | ([Char]
    target, [[Char]]
    expected, [Char]
    got) <- [([Char], [[Char]], [Char])]
    targets
          ]
      UnknownBuildTarget [([Char], [([Char], [Char])])]
    targets ->
        [[Char]] -> [Char]
    unlines
          [ [Char]
    "Unknown build target '"
            [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    target
            [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "'.\nThere is no "
            [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char] -> [[Char]] -> [Char]
    forall a. [a] -> [[a]] -> [a]
    intercalate
              [Char]
    " or "
              [ ShowS
    mungeThing [Char]
    thing [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " '" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    got [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "'"
              | ([Char]
    thing, [Char]
    got) <- [([Char], [Char])]
    nosuch
              ]
            [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "."
          | ([Char]
    target, [([Char], [Char])]
    nosuch) <- [([Char], [([Char], [Char])])]
    targets
          ]
        where
          mungeThing :: ShowS
    mungeThing [Char]
    "file" = [Char]
    "file target"
          mungeThing [Char]
    thing = [Char]
    thing
      AmbiguousBuildTarget [([Char], [([Char], [Char])])]
    targets ->
        [[Char]] -> [Char]
    unlines
          [ [Char]
    "Ambiguous build target '"
            [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    target
            [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "'. It could be:\n "
            [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [[Char]] -> [Char]
    unlines
              [ [Char]
    "   "
                [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    ut
                [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " ("
                [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    bt
                [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    ")"
              | ([Char]
    ut, [Char]
    bt) <- [([Char], [Char])]
    amb
              ]
          | ([Char]
    target, [([Char], [Char])]
    amb) <- [([Char], [([Char], [Char])])]
    targets
          ]
      CheckBuildTargets [Char]
    errorStr -> [Char]
    errorStr
      VersionMismatchGHC [Char]
    ghcProgPath Version
    ghcVersion [Char]
    ghcPkgProgPath Version
    ghcPkgVersion ->
        [Char]
    "Version mismatch between ghc and ghc-pkg: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    ghcProgPath
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " is version "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Version -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow Version
    ghcVersion
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    ghcPkgProgPath
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " is version "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Version -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow Version
    ghcPkgVersion
      CabalException
    CheckPackageDbStackPost76 ->
        [Char]
    "If the global package db is specified, it must be "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "specified first and cannot be specified multiple times"
      CabalException
    CheckPackageDbStackPre76 ->
        [Char]
    "With current ghc versions the global package db is always used "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "and must be listed first. This ghc limitation is lifted in GHC 7.6,"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "see https://gitlab.haskell.org/ghc/ghc/-/issues/5977"
      CabalException
    GlobalPackageDbSpecifiedFirst ->
        [Char]
    "If the global package db is specified, it must be "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "specified first and cannot be specified multiple times"
      CabalException
    CantInstallForeignLib -> [Char]
    "Can't install foreign-library symlink on non-Linux OS"
      NoSupportForPreProcessingTest TestType
    tt ->
        [Char]
    "No support for preprocessing test "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "suite type "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ TestType -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow TestType
    tt
      NoSupportForPreProcessingBenchmark BenchmarkType
    tt ->
        [Char]
    "No support for preprocessing benchmark type "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ BenchmarkType -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow BenchmarkType
    tt
      CantFindSourceForPreProcessFile [Char]
    errorStr -> [Char]
    errorStr
      NoSupportPreProcessingTestExtras TestType
    tt ->
        [Char]
    "No support for preprocessing test suite type "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ TestType -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow TestType
    tt
      NoSupportPreProcessingBenchmarkExtras BenchmarkType
    tt ->
        [Char]
    "No support for preprocessing benchmark "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "type "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ BenchmarkType -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow BenchmarkType
    tt
      UnlitException [Char]
    str -> [Char]
    str
      RunProgramInvocationException [Char]
    path [Char]
    errors -> [Char]
    "'" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    path [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "' exited with an error:\n" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    errors
      GetProgramInvocationException [Char]
    path [Char]
    errors -> [Char]
    "'" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    path [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "' exited with an error:\n" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    errors
      GetProgramInvocationLBSException [Char]
    path [Char]
    errors -> [Char]
    "'" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    path [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "' exited with an error:\n" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    errors
      CabalException
    CheckSemaphoreSupport ->
        [Char]
    "Your compiler does not support the -jsem flag. "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "To use this feature you must use GHC 9.8 or later."
      CabalException
    NoLibraryForPackage ->
        [Char]
    "The buildinfo contains info for a library, "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "but the package does not have a library."
      SanityCheckHookedBuildInfo UnqualComponentName
    exe1 ->
        [Char]
    "The buildinfo contains info for an executable called '"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ UnqualComponentName -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow UnqualComponentName
    exe1
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "' but the package does not have an "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "executable with that name."
      ConfigureScriptNotFound [Char]
    fp -> [Char]
    "configure script not found at " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    fp [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "."
      CabalException
    NoValidComponent -> [Char]
    "No valid component targets found"
      CabalException
    ConfigureEitherSingleOrAll -> [Char]
    "Can only configure either a single component or all of them"
      CabalException
    ConfigCIDValidForPreComponent -> [Char]
    "--cid is only supported for per-component configure"
      CabalException
    SanityCheckForEnableComponents ->
        [Char]
    "--enable-tests/--enable-benchmarks are incompatible with"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " explicitly specifying a component to configure."
      CabalException
    SanityCheckForDynamicStaticLinking ->
        [Char]
    "--enable-executable-dynamic and --enable-executable-static"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " are incompatible with each other."
      UnsupportedLanguages PackageIdentifier
    pkgId CompilerId
    compilerId [[Char]]
    langs ->
        [Char]
    "The package "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ PackageIdentifier -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow PackageIdentifier
    pkgId
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " requires the following languages which are not "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "supported by "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ CompilerId -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow CompilerId
    compilerId
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    ": "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char] -> [[Char]] -> [Char]
    forall a. [a] -> [[a]] -> [a]
    intercalate [Char]
    ", " [[Char]]
    langs
      UnsupportedLanguageExtension PackageIdentifier
    pkgId CompilerId
    compilerId [[Char]]
    exts ->
        [Char]
    "The package "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ PackageIdentifier -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow PackageIdentifier
    pkgId
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " requires the following language extensions which are not "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "supported by "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ CompilerId -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow CompilerId
    compilerId
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    ": "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char] -> [[Char]] -> [Char]
    forall a. [a] -> [[a]] -> [a]
    intercalate [Char]
    ", " [[Char]]
    exts
      CantFindForeignLibraries [[Char]]
    unsupportedFLibs ->
        [Char]
    "Cannot build some foreign libraries: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char] -> [[Char]] -> [Char]
    forall a. [a] -> [[a]] -> [a]
    intercalate [Char]
    ", " [[Char]]
    unsupportedFLibs
      ExpectedAbsoluteDirectory [Char]
    fPath -> [Char]
    "expected an absolute directory name for --prefix: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    fPath
      FlagsNotSpecified [FlagName]
    diffFlags ->
        [Char]
    "'--exact-configuration' was given, "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "but the following flags were not specified: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char] -> [[Char]] -> [Char]
    forall a. [a] -> [[a]] -> [a]
    intercalate [Char]
    ", " ((FlagName -> [Char]) -> [FlagName] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    map FlagName -> [Char]
    forall a. Show a => a -> [Char]
    show [FlagName]
    diffFlags)
      EncounteredMissingDependency [MissingDependency]
    missing ->
        [Char]
    "Encountered missing or private dependencies:\n"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ ( Doc -> [Char]
    render
                (Doc -> [Char])
    -> ([MissingDependency] -> Doc) -> [MissingDependency] -> [Char]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Int -> Doc -> Doc
    nest Int
    4
                (Doc -> Doc)
    -> ([MissingDependency] -> Doc) -> [MissingDependency] -> Doc
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [Doc] -> Doc
    sep
                ([Doc] -> Doc)
    -> ([MissingDependency] -> [Doc]) -> [MissingDependency] -> Doc
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Doc -> [Doc] -> [Doc]
    punctuate Doc
    comma
                ([Doc] -> [Doc])
    -> ([MissingDependency] -> [Doc]) -> [MissingDependency] -> [Doc]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (MissingDependency -> Doc) -> [MissingDependency] -> [Doc]
    forall a b. (a -> b) -> [a] -> [b]
    map MissingDependency -> Doc
    forall a. Pretty a => a -> Doc
    pretty
                ([MissingDependency] -> [Char]) -> [MissingDependency] -> [Char]
    forall a b. (a -> b) -> a -> b
    $ [MissingDependency]
    missing
             )
      CabalException
    CompilerDoesn'tSupportThinning ->
        [Char]
    "Your compiler does not support thinning and renaming on "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "package flags.  To use this feature you must use "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "GHC 7.9 or later."
      CabalException
    CompilerDoesn'tSupportReexports ->
        [Char]
    "Your compiler does not support module re-exports. To use "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "this feature you must use GHC 7.9 or later."
      CabalException
    CompilerDoesn'tSupportBackpack ->
        [Char]
    "Your compiler does not support Backpack. To use "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "this feature you must use GHC 8.1 or later."
      LibraryWithinSamePackage [PackageIdentifier]
    internalPkgDeps ->
        [Char]
    "The field 'build-depends: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char] -> [[Char]] -> [Char]
    forall a. [a] -> [[a]] -> [a]
    intercalate [Char]
    ", " ((PackageIdentifier -> [Char]) -> [PackageIdentifier] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    map (PackageName -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow (PackageName -> [Char])
    -> (PackageIdentifier -> PackageName)
    -> PackageIdentifier
    -> [Char]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . PackageIdentifier -> PackageName
    forall pkg. Package pkg => pkg -> PackageName
    packageName) [PackageIdentifier]
    internalPkgDeps)
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "' refers to a library which is defined within the same "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "package. To use this feature the package must specify at "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "least 'cabal-version: >= 1.8'."
      ReportFailedDependencies [FailedDependency]
    failed [Char]
    hackageUrl -> [Char] -> [[Char]] -> [Char]
    forall a. [a] -> [[a]] -> [a]
    intercalate [Char]
    "\n\n" ((FailedDependency -> [Char]) -> [FailedDependency] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    map FailedDependency -> [Char]
    reportFailedDependency [FailedDependency]
    failed)
        where
          reportFailedDependency :: FailedDependency -> [Char]
    reportFailedDependency (DependencyNotExists PackageName
    pkgname) =
            [Char]
    "there is no version of "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ PackageName -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow PackageName
    pkgname
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " installed.\n"
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "Perhaps you need to download and install it from\n"
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    hackageUrl
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ PackageName -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow PackageName
    pkgname
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "?"
          reportFailedDependency (DependencyMissingInternal PackageName
    pkgname LibraryName
    lib) =
            [Char]
    "internal dependency "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Doc -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow (LibraryName -> Doc
    prettyLibraryNameComponent LibraryName
    lib)
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " not installed.\n"
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "Perhaps you need to configure and install it first?\n"
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "(This library was defined by "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ PackageName -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow PackageName
    pkgname
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    ")"
          reportFailedDependency (DependencyNoVersion Dependency
    dep) =
            [Char]
    "cannot satisfy dependency " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Dependency -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow (Dependency -> Dependency
    simplifyDependency Dependency
    dep) [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "\n"
      CabalException
    NoPackageDatabaseSpecified ->
        [Char]
    "No package databases have been specified. If you use "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "--package-db=clear, you must follow it with --package-db= "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "with 'global', 'user' or a specific file."
      HowToFindInstalledPackages CompilerFlavor
    flv ->
        [Char]
    "don't know how to find the installed packages for "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ CompilerFlavor -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow CompilerFlavor
    flv
      PkgConfigNotFound [Char]
    pkg [Char]
    versionReq ->
        [Char]
    "The pkg-config package '"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    pkg
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "'"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    versionReq
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " is required but it could not be found."
      BadVersion [Char]
    pkg [Char]
    versionReq PkgconfigVersion
    v ->
        [Char]
    "The pkg-config package '"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    pkg
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "'"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    versionReq
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " is required but the version installed on the"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " system is version "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ PkgconfigVersion -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow PkgconfigVersion
    v
      CabalException
    UnknownCompilerException -> [Char]
    "Unknown compiler"
      CabalException
    NoWorkingGcc ->
        [[Char]] -> [Char]
    unlines
          [ [Char]
    "No working gcc"
          , [Char]
    "This package depends on a foreign library but we cannot "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "find a working C compiler. If you have it in a "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "non-standard location you can use the --with-gcc "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "flag to specify it."
          ]
      NoOSSupport OS
    os [Char]
    what ->
        [Char]
    "Operating system: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ OS -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow OS
    os
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    ", does not support "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    what
      NoCompilerSupport [Char]
    comp ->
        [Char]
    "Compiler: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    comp
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    ", does not support relocatable builds"
      InstallDirsNotPrefixRelative InstallDirs [Char]
    installDirs -> [Char]
    "Installation directories are not prefix_relative:\n" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ InstallDirs [Char] -> [Char]
    forall a. Show a => a -> [Char]
    show InstallDirs [Char]
    installDirs
      ExplainErrors Maybe (Either [Char] [Char])
    hdr [[Char]]
    libs ->
        [[Char]] -> [Char]
    unlines ([[Char]] -> [Char]) -> [[Char]] -> [Char]
    forall a b. (a -> b) -> a -> b
    $
          [ if Bool
    plural
            then [Char]
    "Missing dependencies on foreign libraries:"
            else [Char]
    "Missing dependency on a foreign library:"
          | Bool
    missing
          ]
            [[Char]] -> [[Char]] -> [[Char]]
    forall a. [a] -> [a] -> [a]
    ++ case Maybe (Either [Char] [Char])
    hdr of
              Just (Left [Char]
    h) -> [[Char]
    "* Missing (or bad) header file: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    h]
              Maybe (Either [Char] [Char])
    _ -> []
            [[Char]] -> [[Char]] -> [[Char]]
    forall a. [a] -> [a] -> [a]
    ++ case [[Char]]
    libs of
              [] -> []
              [[Char]
    lib] -> [[Char]
    "* Missing (or bad) C library: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    lib]
              [[Char]]
    _ ->
                [ [Char]
    "* Missing (or bad) C libraries: "
                    [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char] -> [[Char]] -> [Char]
    forall a. [a] -> [[a]] -> [a]
    intercalate [Char]
    ", " [[Char]]
    libs
                ]
                  [[Char]] -> [[Char]] -> [[Char]]
    forall a. [a] -> [a] -> [a]
    ++ [if Bool
    plural then [Char]
    messagePlural else [Char]
    messageSingular | Bool
    missing]
            [[Char]] -> [[Char]] -> [[Char]]
    forall a. [a] -> [a] -> [a]
    ++ case Maybe (Either [Char] [Char])
    hdr of
              Just (Left [Char]
    _) -> [[Char]
    headerCppMessage]
              Just (Right [Char]
    h) ->
                [ (if Bool
    missing then [Char]
    "* " else [Char]
    "")
                    [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "Bad header file: "
                    [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    h
                , [Char]
    headerCcMessage
                ]
              Maybe (Either [Char] [Char])
    _ -> []
        where
          plural :: Bool
    plural = [[Char]] -> Int
    forall a. [a] -> Int
    forall (t :: * -> *) a. Foldable t => t a -> Int
    length [[Char]]
    libs Int -> Int -> Bool
    forall a. Ord a => a -> a -> Bool
    >= Int
    2
          -- Is there something missing? (as opposed to broken)
          missing :: Bool
    missing =
            Bool -> Bool
    not ([[Char]] -> Bool
    forall a. [a] -> Bool
    forall (t :: * -> *) a. Foldable t => t a -> Bool
    null [[Char]]
    libs)
              Bool -> Bool -> Bool
    || case Maybe (Either [Char] [Char])
    hdr of Just (Left [Char]
    _) -> Bool
    True; Maybe (Either [Char] [Char])
    _ -> Bool
    False
          messageSingular :: [Char]
    messageSingular =
            [Char]
    "This problem can usually be solved by installing the system "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "package that provides this library (you may need the "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "\"-dev\" version). If the library is already installed "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "but in a non-standard location then you can use the flags "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "--extra-include-dirs= and --extra-lib-dirs= to specify "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "where it is."
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "If the library file does exist, it may contain errors that "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "are caught by the C compiler at the preprocessing stage. "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "In this case you can re-run 'Setup configure' with the "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "verbosity flag -v3 to see the error messages."
          messagePlural :: [Char]
    messagePlural =
            [Char]
    "This problem can usually be solved by installing the system "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "packages that provide these libraries (you may need the "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "\"-dev\" versions). If the libraries are already installed "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "but in a non-standard location then you can use the flags "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "--extra-include-dirs= and --extra-lib-dirs= to specify "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "where they are."
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "If the library files do exist, it may contain errors that "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "are caught by the C compiler at the preprocessing stage. "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "In this case you can re-run 'Setup configure' with the "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "verbosity flag -v3 to see the error messages."
          headerCppMessage :: [Char]
    headerCppMessage =
            [Char]
    "If the header file does exist, it may contain errors that "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "are caught by the C compiler at the preprocessing stage. "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "In this case you can re-run 'Setup configure' with the "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "verbosity flag -v3 to see the error messages."
          headerCcMessage :: [Char]
    headerCcMessage =
            [Char]
    "The header file contains a compile error. "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "You can re-run 'Setup configure' with the verbosity flag "
              [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "-v3 to see the error messages from the C compiler."
      CheckPackageProblems [[Char]]
    errors -> [Char] -> [[Char]] -> [Char]
    forall a. [a] -> [[a]] -> [a]
    intercalate [Char]
    "\n\n" [[Char]]
    errors
      LibDirDepsPrefixNotRelative [Char]
    l [Char]
    p ->
        [Char]
    "Library directory of a dependency: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ ShowS
    forall a. Show a => a -> [Char]
    show [Char]
    l
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "\nis not relative to the installation prefix:\n"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ ShowS
    forall a. Show a => a -> [Char]
    show [Char]
    p
      CombinedConstraints Doc
    dispDepend ->
        Doc -> [Char]
    render (Doc -> [Char]) -> Doc -> [Char]
    forall a b. (a -> b) -> a -> b
    $
          [Char] -> Doc
    text [Char]
    "The following package dependencies were requested"
            Doc -> Doc -> Doc
    $+$ Int -> Doc -> Doc
    nest Int
    4 Doc
    dispDepend
            Doc -> Doc -> Doc
    $+$ [Char] -> Doc
    text [Char]
    "however the given installed package instance does not exist."
      CabalException
    CantParseGHCOutput -> [Char]
    "Can't parse --info output of GHC"
      IncompatibleWithCabal [Char]
    compilerName [Char]
    packagePathEnvVar ->
        [Char]
    "Use of "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    compilerName
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "'s environment variable "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    packagePathEnvVar
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " is incompatible with Cabal. Use the "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "flag --package-db to specify a package database (it can be "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "used multiple times)."
      Couldn'tFindTestProgram [Char]
    cmd ->
        [Char]
    "Could not find test program \""
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    cmd
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "\". Did you build the package first?"
      CabalException
    TestCoverageSupport -> [Char]
    "Test coverage is only supported for packages with a library component."
      Couldn'tFindTestProgLibV09 [Char]
    cmd ->
        [Char]
    "Could not find test program \""
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    cmd
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "\". Did you build the package first?"
      CabalException
    TestCoverageSupportLibV09 -> [Char]
    "Test coverage is only supported for packages with a library component."
      RawSystemStdout [Char]
    errors -> [Char]
    errors
      FindFile [Char]
    fileName -> [Char]
    fileName [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " doesn't exist"
      FindModuleFileEx ModuleName
    mod_name [Suffix]
    extensions [[Char]]
    searchPath ->
        [Char]
    "Could not find module: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ ModuleName -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow ModuleName
    mod_name
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " with any suffix: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [[Char]] -> [Char]
    forall a. Show a => a -> [Char]
    show ((Suffix -> [Char]) -> [Suffix] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    map Suffix -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow [Suffix]
    extensions)
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " in the search path: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [[Char]] -> [Char]
    forall a. Show a => a -> [Char]
    show [[Char]]
    searchPath
      MultipleFilesWithExtension [Char]
    buildInfoExt -> [Char]
    "Multiple files with extension " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    buildInfoExt
      CabalException
    NoDesc ->
        [Char]
    "No cabal file found.\n"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "Please create a package description file <pkgname>.cabal"
      MultiDesc [[Char]]
    l ->
        [Char]
    "Multiple cabal files found.\n"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "Please use only one of: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char] -> [[Char]] -> [Char]
    forall a. [a] -> [[a]] -> [a]
    intercalate [Char]
    ", " [[Char]]
    l
      CabalException
    RelocRegistrationInfo ->
        [Char]
    "Distribution.Simple.Register.relocRegistrationInfo: \
        \not implemented for this compiler"
      CabalException
    CreatePackageDB ->
        [Char]
    "Distribution.Simple.Register.createPackageDB: "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "not implemented for this compiler"
      WithHcPkg [Char]
    name ->
        [Char]
    "Distribution.Simple.Register."
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    name
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    ":\
             \not implemented for this compiler"
      CabalException
    RegisMultiplePkgNotSupported -> [Char]
    "Registering multiple package instances is not yet supported for this compiler"
      CabalException
    RegisteringNotImplemented -> [Char]
    "Registering is not implemented for this compiler"
      CabalException
    NoTestSuitesEnabled ->
        [Char]
    "No test suites enabled. Did you remember to 'Setup configure' with "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "\'--enable-tests\'?"
      TestNameDisabled [Char]
    tName ->
        [Char]
    "Package configured with test suite "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    tName
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " disabled."
      NoSuchTest [Char]
    tName -> [Char]
    "no such test: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    tName
      ConfigureProgram [Char]
    name [Char]
    path ->
        [Char]
    "Cannot find the program '"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    name
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "'. User-specified path '"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    path
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "' does not refer to an executable and "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "the program is not on the system path."
      RequireProgram [Char]
    progName -> [Char]
    "The program '" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    progName [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "' is required but it could not be found."
      NoProgramFound [Char]
    progName VersionRange
    versionRange ->
        [Char]
    "The program '"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    progName
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "'"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ VersionRange -> [Char]
    versionRequirement VersionRange
    versionRange
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " is required but it could not be found."
      BadVersionDb [Char]
    progName Version
    version VersionRange
    range [Char]
    locationPath ->
        [Char]
    "The program '"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    progName
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "'"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ VersionRange -> [Char]
    versionRequirement VersionRange
    range
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " is required but the version found at "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    locationPath
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " is version "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Version -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow Version
    version
      UnknownVersionDb [Char]
    progName VersionRange
    versionRange [Char]
    locationPath ->
        [Char]
    "The program '"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    progName
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "'"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ VersionRange -> [Char]
    versionRequirement VersionRange
    versionRange
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " is required but the version of "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    locationPath
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " could not be determined."
      MissingCoveredInstalledLibrary UnitId
    unitId ->
        [Char]
    "Failed to find the installed unit '"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ UnitId -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow UnitId
    unitId
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "' in package database stack."
      SetupHooksException SetupHooksException
    err ->
        SetupHooksException -> [Char]
    setupHooksExceptionMessage SetupHooksException
    err
      MultiReplDoesNotSupportComplexReexportedModules PackageName
    pname ComponentName
    cname ->
        [Char]
    "When attempting start the repl for "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ ComponentName -> [Char]
    showComponentName ComponentName
    cname
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " from package "
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ PackageName -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow PackageName
    pname
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " a module renaming was found.\n"
          [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "Multi-repl does not work with complicated reexported-modules until GHC-9.12."