    {-# LANGUAGE CPP #-}
    {-# LANGUAGE DataKinds #-}
    {-# LANGUAGE DeriveGeneric #-}
    {-# LANGUAGE FlexibleContexts #-}
    {-# LANGUAGE PatternSynonyms #-}
    {-# LANGUAGE RankNTypes #-}
    {-# LANGUAGE ViewPatterns #-}

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

    -- |
    -- Module      :  Distribution.Simple.Setup.Config
    -- Copyright   :  Isaac Jones 2003-2004
    --                Duncan Coutts 2007
    -- License     :  BSD3
    --
    -- Maintainer  :  cabal-devel@haskell.org
    -- Portability :  portable
    --
    -- Definition of the configure command-line options.
    -- See: @Distribution.Simple.Setup@
    module Distribution.Simple.Setup.Config
      ( ConfigFlags
          ( ConfigCommonFlags
          , configVerbosity
          , configDistPref
          , configCabalFilePath
          , configWorkingDir
          , configTargets
          , ..
          )
      , emptyConfigFlags
      , defaultConfigFlags
      , configureCommand
      , configPrograms
      , readPackageDb
      , readPackageDbList
      , showPackageDb
      , showPackageDbList
      , configureArgs
      , configureOptions
      , installDirsOptions
      ) where

    import Distribution.Compat.Prelude hiding (get)
    import Prelude ()

    import qualified Distribution.Compat.CharParsing as P
    import Distribution.Compat.Semigroup (Last' (..), Option' (..))
    import Distribution.Compat.Stack
    import Distribution.Compiler
    import Distribution.ModuleName
    import Distribution.PackageDescription
    import Distribution.Parsec
    import Distribution.Pretty
    import Distribution.ReadE
    import Distribution.Simple.Command hiding (boolOpt, boolOpt')
    import Distribution.Simple.Compiler
    import Distribution.Simple.Flag
    import Distribution.Simple.InstallDirs
    import Distribution.Simple.Program
    import Distribution.Simple.Setup.Common
    import Distribution.Simple.Utils
    import Distribution.Types.ComponentId
    import Distribution.Types.DumpBuildInfo
    import Distribution.Types.GivenComponent
    import Distribution.Types.Module
    import Distribution.Types.PackageVersionConstraint
    import Distribution.Types.UnitId
    import Distribution.Utils.NubList
    import Distribution.Utils.Path
    import Distribution.Verbosity

    import qualified Text.PrettyPrint as Disp

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

    -- * Config flags

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

    -- | Flags to @configure@ command.
    --
    -- IMPORTANT: every time a new flag is added, 'D.C.Setup.filterConfigureFlags'
    -- should be updated.
    -- IMPORTANT: every time a new flag is added, it should be added to the Eq instance
    data ConfigFlags = ConfigFlags
      { ConfigFlags -> CommonSetupFlags
    configCommonFlags :: !CommonSetupFlags
      , -- FIXME: the configPrograms is only here to pass info through to configure
        -- because the type of configure is constrained by the UserHooks.
        -- when we change UserHooks next we should pass the initial
        -- ProgramDb directly and not via ConfigFlags
        ConfigFlags -> Option' (Last' ProgramDb)
    configPrograms_ :: Option' (Last' ProgramDb)
      -- ^ All programs that
      --  @cabal@ may run
      , ConfigFlags -> [([Char], [Char])]
    configProgramPaths :: [(String, FilePath)]
      -- ^ user specified programs paths
      , ConfigFlags -> [([Char], [[Char]])]
    configProgramArgs :: [(String, [String])]
      -- ^ user specified programs args
      , ConfigFlags -> NubList [Char]
    configProgramPathExtra :: NubList FilePath
      -- ^ Extend the $PATH
      , ConfigFlags -> Last CompilerFlavor
    configHcFlavor :: Flag CompilerFlavor
      -- ^ The \"flavor\" of the
      --  compiler, e.g. GHC.
      , ConfigFlags -> Flag [Char]
    configHcPath :: Flag FilePath
      -- ^ given compiler location
      , ConfigFlags -> Flag [Char]
    configHcPkg :: Flag FilePath
      -- ^ given hc-pkg location
      , ConfigFlags -> Flag Bool
    configVanillaLib :: Flag Bool
      -- ^ Enable vanilla library
      , ConfigFlags -> Flag Bool
    configProfLib :: Flag Bool
      -- ^ Enable profiling in the library
      , ConfigFlags -> Flag Bool
    configSharedLib :: Flag Bool
      -- ^ Build shared library
      , ConfigFlags -> Flag Bool
    configStaticLib :: Flag Bool
      -- ^ Build static library
      , ConfigFlags -> Flag Bool
    configDynExe :: Flag Bool
      -- ^ Enable dynamic linking of the
      --  executables.
      , ConfigFlags -> Flag Bool
    configFullyStaticExe :: Flag Bool
      -- ^ Enable fully static linking of the
      --  executables.
      , ConfigFlags -> Flag Bool
    configProfExe :: Flag Bool
      -- ^ Enable profiling in the
      --  executables.
      , ConfigFlags -> Flag Bool
    configProf :: Flag Bool
      -- ^ Enable profiling in the library
      --  and executables.
      , ConfigFlags -> Flag Bool
    configProfShared :: Flag Bool
      -- ^ Enable shared profiling objects
      , ConfigFlags -> Last ProfDetailLevel
    configProfDetail :: Flag ProfDetailLevel
      -- ^ Profiling detail level
      --   in the library and executables.
      , ConfigFlags -> Last ProfDetailLevel
    configProfLibDetail :: Flag ProfDetailLevel
      -- ^ Profiling  detail level
      --  in the library
      , ConfigFlags -> [[Char]]
    configConfigureArgs :: [String]
      -- ^ Extra arguments to @configure@
      , ConfigFlags -> Last OptimisationLevel
    configOptimization :: Flag OptimisationLevel
      -- ^ Enable optimization.
      , ConfigFlags -> Flag PathTemplate
    configProgPrefix :: Flag PathTemplate
      -- ^ Installed executable prefix.
      , ConfigFlags -> Flag PathTemplate
    configProgSuffix :: Flag PathTemplate
      -- ^ Installed executable suffix.
      , ConfigFlags -> InstallDirs (Flag PathTemplate)
    configInstallDirs :: InstallDirs (Flag PathTemplate)
      -- ^ Installation
      --  paths
      , ConfigFlags -> Flag [Char]
    configScratchDir :: Flag FilePath
      , ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)]
    configExtraLibDirs :: [SymbolicPath Pkg (Dir Lib)]
      -- ^ path to search for extra libraries
      , ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)]
    configExtraLibDirsStatic :: [SymbolicPath Pkg (Dir Lib)]
      -- ^ path to search for extra
      --   libraries when linking
      --   fully static executables
      , ConfigFlags -> [SymbolicPath Pkg ('Dir Framework)]
    configExtraFrameworkDirs :: [SymbolicPath Pkg (Dir Framework)]
      -- ^ path to search for extra
      -- frameworks (OS X only)
      , ConfigFlags -> [SymbolicPath Pkg ('Dir Include)]
    configExtraIncludeDirs :: [SymbolicPath Pkg (Dir Include)]
      -- ^ path to search for header files
      , ConfigFlags -> Flag [Char]
    configIPID :: Flag String
      -- ^ explicit IPID to be used
      , ConfigFlags -> Flag ComponentId
    configCID :: Flag ComponentId
      -- ^ explicit CID to be used
      , ConfigFlags -> Flag Bool
    configDeterministic :: Flag Bool
      -- ^ be as deterministic as possible
      -- (e.g., invariant over GHC, database,
      -- etc).  Used by the test suite
      , ConfigFlags -> Flag Bool
    configUserInstall :: Flag Bool
      -- ^ The --user\/--global flag
      , ConfigFlags -> [Maybe PackageDB]
    configPackageDBs :: [Maybe PackageDB]
      -- ^ Which package DBs to use
      , ConfigFlags -> Flag Bool
    configGHCiLib :: Flag Bool
      -- ^ Enable compiling library for GHCi
      , ConfigFlags -> Flag Bool
    configSplitSections :: Flag Bool
      -- ^ Enable -split-sections with GHC
      , ConfigFlags -> Flag Bool
    configSplitObjs :: Flag Bool
      -- ^ Enable -split-objs with GHC
      , ConfigFlags -> Flag Bool
    configStripExes :: Flag Bool
      -- ^ Enable executable stripping
      , ConfigFlags -> Flag Bool
    configStripLibs :: Flag Bool
      -- ^ Enable library stripping
      , ConfigFlags -> [PackageVersionConstraint]
    configConstraints :: [PackageVersionConstraint]
      -- ^ Additional constraints for
      --  dependencies.
      , ConfigFlags -> [GivenComponent]
    configDependencies :: [GivenComponent]
      -- ^ The packages depended on which already exist
      , ConfigFlags -> [PromisedComponent]
    configPromisedDependencies :: [PromisedComponent]
      -- ^ The packages depended on which doesn't yet exist (i.e. promised).
      --  Promising dependencies enables us to configure components in parallel,
      --  and avoids expensive builds if they are not necessary.
      --  For example, in multi-repl mode, we don't want to build dependencies that
      --  are loaded into the interactive session, since we have to build them again.
      , ConfigFlags -> [(ModuleName, Module)]
    configInstantiateWith :: [(ModuleName, Module)]
      -- ^ The requested Backpack instantiation.  If empty, either this
      -- package does not use Backpack, or we just want to typecheck
      -- the indefinite package.
      , ConfigFlags -> FlagAssignment
    configConfigurationsFlags :: FlagAssignment
      , ConfigFlags -> Flag Bool
    configTests :: Flag Bool
      -- ^ Enable test suite compilation
      , ConfigFlags -> Flag Bool
    configBenchmarks :: Flag Bool
      -- ^ Enable benchmark compilation
      , ConfigFlags -> Flag Bool
    configCoverage :: Flag Bool
      -- ^ Enable program coverage
      , ConfigFlags -> Flag Bool
    configLibCoverage :: Flag Bool
      -- ^ Enable program coverage (deprecated)
      , ConfigFlags -> Flag Bool
    configExactConfiguration :: Flag Bool
      -- ^ All direct dependencies and flags are provided on the command line by
      --  the user via the '--dependency' and '--flags' options.
      , ConfigFlags -> Flag [Char]
    configFlagError :: Flag String
      -- ^ Halt and show an error message indicating an error in flag assignment
      , ConfigFlags -> Flag Bool
    configRelocatable :: Flag Bool
      -- ^ Enable relocatable package built
      , ConfigFlags -> Last DebugInfoLevel
    configDebugInfo :: Flag DebugInfoLevel
      -- ^ Emit debug info.
      , ConfigFlags -> Last DumpBuildInfo
    configDumpBuildInfo :: Flag DumpBuildInfo
      -- ^ Should we dump available build information on build?
      -- Dump build information to disk before attempting to build,
      -- tooling can parse these files and use them to compile the
      -- source files themselves.
      , ConfigFlags -> Flag Bool
    configUseResponseFiles :: Flag Bool
      -- ^ Whether to use response files at all. They're used for such tools
      -- as haddock, or ld.
      , ConfigFlags -> Flag Bool
    configAllowDependingOnPrivateLibs :: Flag Bool
      -- ^ Allow depending on private sublibraries. This is used by external
      -- tools (like cabal-install) so they can add multiple-public-libraries
      -- compatibility to older ghcs by checking visibility externally.
      , ConfigFlags -> Last [UnitId]
    configCoverageFor :: Flag [UnitId]
      -- ^ The list of libraries to be included in the hpc coverage report for
      -- testsuites run with @--enable-coverage@. Notably, this list must exclude
      -- indefinite libraries and instantiations because HPC does not support
      -- backpack (Nov. 2023).
      , ConfigFlags -> Flag Bool
    configIgnoreBuildTools :: Flag Bool
      -- ^ When this flag is set, all tools declared in `build-tool`s and
      -- `build-tool-depends` will be ignored. This allows a Cabal package with
      -- build-tool-dependencies to be built even if the tool is not found.
      }
      deriving ((forall x. ConfigFlags -> Rep ConfigFlags x)
    -> (forall x. Rep ConfigFlags x -> ConfigFlags)
    -> Generic ConfigFlags
    forall x. Rep ConfigFlags x -> ConfigFlags
    forall x. ConfigFlags -> Rep ConfigFlags x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. ConfigFlags -> Rep ConfigFlags x
    from :: forall x. ConfigFlags -> Rep ConfigFlags x
    $cto :: forall x. Rep ConfigFlags x -> ConfigFlags
    to :: forall x. Rep ConfigFlags x -> ConfigFlags
    Generic, ReadPrec [ConfigFlags]
    ReadPrec ConfigFlags
    Int -> ReadS ConfigFlags
    ReadS [ConfigFlags]
    (Int -> ReadS ConfigFlags)
    -> ReadS [ConfigFlags]
    -> ReadPrec ConfigFlags
    -> ReadPrec [ConfigFlags]
    -> Read ConfigFlags
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS ConfigFlags
    readsPrec :: Int -> ReadS ConfigFlags
    $creadList :: ReadS [ConfigFlags]
    readList :: ReadS [ConfigFlags]
    $creadPrec :: ReadPrec ConfigFlags
    readPrec :: ReadPrec ConfigFlags
    $creadListPrec :: ReadPrec [ConfigFlags]
    readListPrec :: ReadPrec [ConfigFlags]
    Read, Int -> ConfigFlags -> ShowS
    [ConfigFlags] -> ShowS
    ConfigFlags -> [Char]
    (Int -> ConfigFlags -> ShowS)
    -> (ConfigFlags -> [Char])
    -> ([ConfigFlags] -> ShowS)
    -> Show ConfigFlags
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ConfigFlags -> ShowS
    showsPrec :: Int -> ConfigFlags -> ShowS
    $cshow :: ConfigFlags -> [Char]
    show :: ConfigFlags -> [Char]
    $cshowList :: [ConfigFlags] -> ShowS
    showList :: [ConfigFlags] -> ShowS
    Show)

    pattern ConfigCommonFlags
      :: Flag Verbosity
      -> Flag (SymbolicPath Pkg (Dir Dist))
      -> Flag (SymbolicPath CWD (Dir Pkg))
      -> Flag (SymbolicPath Pkg File)
      -> [String]
      -> ConfigFlags
    pattern $mConfigCommonFlags :: forall {r}.
    ConfigFlags
    -> (Flag Verbosity
        -> Flag (SymbolicPath Pkg ('Dir Dist))
        -> Flag (SymbolicPath CWD ('Dir Pkg))
        -> Flag (SymbolicPath Pkg 'File)
        -> [[Char]]
        -> r)
    -> ((# #) -> r)
    -> r
    ConfigCommonFlags
      { ConfigFlags -> Flag Verbosity
    configVerbosity
      , ConfigFlags -> Flag (SymbolicPath Pkg ('Dir Dist))
    configDistPref
      , ConfigFlags -> Flag (SymbolicPath CWD ('Dir Pkg))
    configWorkingDir
      , ConfigFlags -> Flag (SymbolicPath Pkg 'File)
    configCabalFilePath
      , ConfigFlags -> [[Char]]
    configTargets
      } <-
      ( configCommonFlags ->
          CommonSetupFlags
            { setupVerbosity = configVerbosity
            , setupDistPref = configDistPref
            , setupWorkingDir = configWorkingDir
            , setupCabalFilePath = configCabalFilePath
            , setupTargets = configTargets
            }
        )

    instance Binary ConfigFlags
    instance Structured ConfigFlags

    -- | More convenient version of 'configPrograms'. Results in an
    -- 'error' if internal invariant is violated.
    configPrograms :: WithCallStack (ConfigFlags -> ProgramDb)
    configPrograms :: WithCallStack (ConfigFlags -> ProgramDb)
    configPrograms =
      ProgramDb -> Maybe ProgramDb -> ProgramDb
    forall a. a -> Maybe a -> a
    fromMaybe ([Char] -> ProgramDb
    forall a. HasCallStack => [Char] -> a
    error [Char]
    "FIXME: remove configPrograms")
        (Maybe ProgramDb -> ProgramDb)
    -> (ConfigFlags -> Maybe ProgramDb) -> ConfigFlags -> ProgramDb
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Last' ProgramDb -> ProgramDb)
    -> Maybe (Last' ProgramDb) -> Maybe ProgramDb
    forall a b. (a -> b) -> Maybe a -> Maybe b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Last' ProgramDb -> ProgramDb
    forall a. Last' a -> a
    getLast'
        (Maybe (Last' ProgramDb) -> Maybe ProgramDb)
    -> (ConfigFlags -> Maybe (Last' ProgramDb))
    -> ConfigFlags
    -> Maybe ProgramDb
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Option' (Last' ProgramDb) -> Maybe (Last' ProgramDb)
    forall a. Option' a -> Maybe a
    getOption'
        (Option' (Last' ProgramDb) -> Maybe (Last' ProgramDb))
    -> (ConfigFlags -> Option' (Last' ProgramDb))
    -> ConfigFlags
    -> Maybe (Last' ProgramDb)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ConfigFlags -> Option' (Last' ProgramDb)
    configPrograms_

    instance Eq ConfigFlags where
      == :: ConfigFlags -> ConfigFlags -> Bool
    (==) ConfigFlags
    a ConfigFlags
    b =
        -- configPrograms skipped: not user specified, has no Eq instance
        (ConfigFlags -> CommonSetupFlags) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> CommonSetupFlags
    configCommonFlags
          Bool -> Bool -> Bool
    && (ConfigFlags -> [([Char], [Char])]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> [([Char], [Char])]
    configProgramPaths
          Bool -> Bool -> Bool
    && (ConfigFlags -> [([Char], [[Char]])]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> [([Char], [[Char]])]
    configProgramArgs
          Bool -> Bool -> Bool
    && (ConfigFlags -> NubList [Char]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> NubList [Char]
    configProgramPathExtra
          Bool -> Bool -> Bool
    && (ConfigFlags -> Last CompilerFlavor) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Last CompilerFlavor
    configHcFlavor
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag [Char]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag [Char]
    configHcPath
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag [Char]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag [Char]
    configHcPkg
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configVanillaLib
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configProfLib
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configSharedLib
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configStaticLib
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configDynExe
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configFullyStaticExe
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configProfExe
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configProf
          Bool -> Bool -> Bool
    && (ConfigFlags -> Last ProfDetailLevel) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Last ProfDetailLevel
    configProfDetail
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configProfShared
          Bool -> Bool -> Bool
    && (ConfigFlags -> Last ProfDetailLevel) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Last ProfDetailLevel
    configProfLibDetail
          Bool -> Bool -> Bool
    && (ConfigFlags -> [[Char]]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> [[Char]]
    configConfigureArgs
          Bool -> Bool -> Bool
    && (ConfigFlags -> Last OptimisationLevel) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Last OptimisationLevel
    configOptimization
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag PathTemplate) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag PathTemplate
    configProgPrefix
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag PathTemplate) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag PathTemplate
    configProgSuffix
          Bool -> Bool -> Bool
    && (ConfigFlags -> InstallDirs (Flag PathTemplate)) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> InstallDirs (Flag PathTemplate)
    configInstallDirs
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag [Char]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag [Char]
    configScratchDir
          Bool -> Bool -> Bool
    && (ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)]
    configExtraLibDirs
          Bool -> Bool -> Bool
    && (ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)]
    configExtraLibDirsStatic
          Bool -> Bool -> Bool
    && (ConfigFlags -> [SymbolicPath Pkg ('Dir Include)]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> [SymbolicPath Pkg ('Dir Include)]
    configExtraIncludeDirs
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag [Char]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag [Char]
    configIPID
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configDeterministic
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configUserInstall
          Bool -> Bool -> Bool
    && (ConfigFlags -> [Maybe PackageDB]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> [Maybe PackageDB]
    configPackageDBs
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configGHCiLib
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configSplitSections
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configSplitObjs
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configStripExes
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configStripLibs
          Bool -> Bool -> Bool
    && (ConfigFlags -> [PackageVersionConstraint]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> [PackageVersionConstraint]
    configConstraints
          Bool -> Bool -> Bool
    && (ConfigFlags -> [GivenComponent]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> [GivenComponent]
    configDependencies
          Bool -> Bool -> Bool
    && (ConfigFlags -> [PromisedComponent]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> [PromisedComponent]
    configPromisedDependencies
          Bool -> Bool -> Bool
    && (ConfigFlags -> FlagAssignment) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> FlagAssignment
    configConfigurationsFlags
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configTests
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configBenchmarks
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configCoverage
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configLibCoverage
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configExactConfiguration
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag [Char]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag [Char]
    configFlagError
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configRelocatable
          Bool -> Bool -> Bool
    && (ConfigFlags -> Last DebugInfoLevel) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Last DebugInfoLevel
    configDebugInfo
          Bool -> Bool -> Bool
    && (ConfigFlags -> Last DumpBuildInfo) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Last DumpBuildInfo
    configDumpBuildInfo
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configUseResponseFiles
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configAllowDependingOnPrivateLibs
          Bool -> Bool -> Bool
    && (ConfigFlags -> Last [UnitId]) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Last [UnitId]
    configCoverageFor
          Bool -> Bool -> Bool
    && (ConfigFlags -> Flag Bool) -> Bool
    forall {a}. Eq a => (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> Flag Bool
    configIgnoreBuildTools
        where
          equal :: (ConfigFlags -> a) -> Bool
    equal ConfigFlags -> a
    f = (a -> a -> Bool)
    -> (ConfigFlags -> a) -> ConfigFlags -> ConfigFlags -> Bool
    forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
    on a -> a -> Bool
    forall a. Eq a => a -> a -> Bool
    (==) ConfigFlags -> a
    f ConfigFlags
    a ConfigFlags
    b

    {- FOURMOLU_DISABLE -}
    defaultConfigFlags :: ProgramDb -> ConfigFlags
    defaultConfigFlags :: ProgramDb -> ConfigFlags
    defaultConfigFlags ProgramDb
    progDb =
      ConfigFlags
    emptyConfigFlags
        { configCommonFlags = defaultCommonSetupFlags
        , configPrograms_ = Option' (Just (Last' progDb))
        , configHcFlavor = maybe NoFlag Flag defaultCompilerFlavor
        , configVanillaLib = Flag True
        , configProfLib = NoFlag
        , configSharedLib = NoFlag
        , configStaticLib = NoFlag
        , configDynExe = Flag False
        , configFullyStaticExe = Flag False
        , configProfExe = NoFlag
        , configProf = NoFlag
        , configProfDetail = NoFlag
        , configProfLibDetail = NoFlag
        , configOptimization = Flag NormalOptimisation
        , configProgPrefix = Flag (toPathTemplate "")
        , configProgSuffix = Flag (toPathTemplate "")
        , configUserInstall = Flag False -- TODO: reverse this
    #if defined(mingw32_HOST_OS)
            -- See #8062 and GHC #21019.
        , configGHCiLib = Flag False
    #else
        , configGHCiLib = NoFlag
    #endif
        , configSplitSections = Flag False
        , configSplitObjs = Flag False -- takes longer, so turn off by default
        , configStripExes = NoFlag
        , configStripLibs = NoFlag
        , configTests = Flag False
        , configBenchmarks = Flag False
        , configCoverage = Flag False
        , configLibCoverage = NoFlag
        , configExactConfiguration = Flag False
        , configFlagError = NoFlag
        , configRelocatable = Flag False
        , configDebugInfo = Flag NoDebugInfo
        , configDumpBuildInfo = NoFlag
        , configUseResponseFiles = NoFlag
        }
    {- FOURMOLU_ENABLE -}

    configureCommand :: ProgramDb -> CommandUI ConfigFlags
    configureCommand :: ProgramDb -> CommandUI ConfigFlags
    configureCommand ProgramDb
    progDb =
      CommandUI
        { commandName :: [Char]
    commandName = [Char]
    "configure"
        , commandSynopsis :: [Char]
    commandSynopsis = [Char]
    "Prepare to build the package."
        , commandDescription :: Maybe ShowS
    commandDescription = ShowS -> Maybe ShowS
    forall a. a -> Maybe a
    Just (ShowS -> Maybe ShowS) -> ShowS -> Maybe ShowS
    forall a b. (a -> b) -> a -> b
    $ \[Char]
    _ ->
            ShowS
    wrapText ShowS -> ShowS
    forall a b. (a -> b) -> a -> b
    $
              [Char]
    "Configure how the package is built by setting "
                [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "package (and other) flags.\n"
                [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "\n"
                [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "The configuration affects several other commands, "
                [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "including build, test, bench, run, repl.\n"
        , commandNotes :: Maybe ShowS
    commandNotes = ShowS -> Maybe ShowS
    forall a. a -> Maybe a
    Just (ShowS -> Maybe ShowS) -> ShowS -> Maybe ShowS
    forall a b. (a -> b) -> a -> b
    $ \[Char]
    _pname -> ProgramDb -> [Char]
    programFlagsDescription ProgramDb
    progDb
        , commandUsage :: ShowS
    commandUsage = \[Char]
    pname ->
            [Char]
    "Usage: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    pname [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " configure [FLAGS]\n"
        , commandDefaultFlags :: ConfigFlags
    commandDefaultFlags = ProgramDb -> ConfigFlags
    defaultConfigFlags ProgramDb
    progDb
        , commandOptions :: ShowOrParseArgs -> [OptionField ConfigFlags]
    commandOptions = \ShowOrParseArgs
    showOrParseArgs ->
            ShowOrParseArgs -> [OptionField ConfigFlags]
    configureOptions ShowOrParseArgs
    showOrParseArgs
              [OptionField ConfigFlags]
    -> [OptionField ConfigFlags] -> [OptionField ConfigFlags]
    forall a. [a] -> [a] -> [a]
    ++ ProgramDb
    -> ShowOrParseArgs
    -> (ConfigFlags -> [([Char], [Char])])
    -> ([([Char], [Char])] -> ConfigFlags -> ConfigFlags)
    -> [OptionField ConfigFlags]
    forall flags.
    ProgramDb
    -> ShowOrParseArgs
    -> (flags -> [([Char], [Char])])
    -> ([([Char], [Char])] -> flags -> flags)
    -> [OptionField flags]
    programDbPaths
                ProgramDb
    progDb
                ShowOrParseArgs
    showOrParseArgs
                ConfigFlags -> [([Char], [Char])]
    configProgramPaths
                (\[([Char], [Char])]
    v ConfigFlags
    fs -> ConfigFlags
    fs{configProgramPaths = v})
              [OptionField ConfigFlags]
    -> [OptionField ConfigFlags] -> [OptionField ConfigFlags]
    forall a. [a] -> [a] -> [a]
    ++ ProgramDb
    -> ShowOrParseArgs
    -> (ConfigFlags -> [([Char], [[Char]])])
    -> ([([Char], [[Char]])] -> ConfigFlags -> ConfigFlags)
    -> [OptionField ConfigFlags]
    forall flags.
    ProgramDb
    -> ShowOrParseArgs
    -> (flags -> [([Char], [[Char]])])
    -> ([([Char], [[Char]])] -> flags -> flags)
    -> [OptionField flags]
    programDbOption
                ProgramDb
    progDb
                ShowOrParseArgs
    showOrParseArgs
                ConfigFlags -> [([Char], [[Char]])]
    configProgramArgs
                (\[([Char], [[Char]])]
    v ConfigFlags
    fs -> ConfigFlags
    fs{configProgramArgs = v})
              [OptionField ConfigFlags]
    -> [OptionField ConfigFlags] -> [OptionField ConfigFlags]
    forall a. [a] -> [a] -> [a]
    ++ ProgramDb
    -> ShowOrParseArgs
    -> (ConfigFlags -> [([Char], [[Char]])])
    -> ([([Char], [[Char]])] -> ConfigFlags -> ConfigFlags)
    -> [OptionField ConfigFlags]
    forall flags.
    ProgramDb
    -> ShowOrParseArgs
    -> (flags -> [([Char], [[Char]])])
    -> ([([Char], [[Char]])] -> flags -> flags)
    -> [OptionField flags]
    programDbOptions
                ProgramDb
    progDb
                ShowOrParseArgs
    showOrParseArgs
                ConfigFlags -> [([Char], [[Char]])]
    configProgramArgs
                (\[([Char], [[Char]])]
    v ConfigFlags
    fs -> ConfigFlags
    fs{configProgramArgs = v})
        }

    -- | Inverse to 'dispModSubstEntry'.
    parsecModSubstEntry :: ParsecParser (ModuleName, Module)
    parsecModSubstEntry :: ParsecParser (ModuleName, Module)
    parsecModSubstEntry = do
      k <- ParsecParser ModuleName
    forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
    forall (m :: * -> *). CabalParsing m => m ModuleName
    parsec
      _ <- P.char '='
      v <- parsec
      return (k, v)

    -- | Pretty-print a single entry of a module substitution.
    dispModSubstEntry :: (ModuleName, Module) -> Disp.Doc
    dispModSubstEntry :: (ModuleName, Module) -> Doc
    dispModSubstEntry (ModuleName
    k, Module
    v) = ModuleName -> Doc
    forall a. Pretty a => a -> Doc
    pretty ModuleName
    k Doc -> Doc -> Doc
    <<>> Char -> Doc
    Disp.char Char
    '=' Doc -> Doc -> Doc
    <<>> Module -> Doc
    forall a. Pretty a => a -> Doc
    pretty Module
    v

    configureOptions :: ShowOrParseArgs -> [OptionField ConfigFlags]
    configureOptions :: ShowOrParseArgs -> [OptionField ConfigFlags]
    configureOptions ShowOrParseArgs
    showOrParseArgs =
      (ConfigFlags -> CommonSetupFlags)
    -> (CommonSetupFlags -> ConfigFlags -> ConfigFlags)
    -> ShowOrParseArgs
    -> [OptionField ConfigFlags]
    -> [OptionField ConfigFlags]
    forall flags.
    (flags -> CommonSetupFlags)
    -> (CommonSetupFlags -> flags -> flags)
    -> ShowOrParseArgs
    -> [OptionField flags]
    -> [OptionField flags]
    withCommonSetupOptions
        ConfigFlags -> CommonSetupFlags
    configCommonFlags
        (\CommonSetupFlags
    c ConfigFlags
    f -> ConfigFlags
    f{configCommonFlags = c})
        ShowOrParseArgs
    showOrParseArgs
        [ [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Last CompilerFlavor)
    -> (Last CompilerFlavor -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Last CompilerFlavor)
         (Last CompilerFlavor -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
            []
            [[Char]
    "compiler"]
            [Char]
    "compiler"
            ConfigFlags -> Last CompilerFlavor
    configHcFlavor
            (\Last CompilerFlavor
    v ConfigFlags
    flags -> ConfigFlags
    flags{configHcFlavor = v})
            ( [(Last CompilerFlavor, ([Char], [[Char]]), [Char])]
    -> MkOptDescr
         (ConfigFlags -> Last CompilerFlavor)
         (Last CompilerFlavor -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Eq b =>
    [(b, ([Char], [[Char]]), [Char])]
    -> MkOptDescr (a -> b) (b -> a -> a) a
    choiceOpt
                [ (CompilerFlavor -> Last CompilerFlavor
    forall a. a -> Last a
    Flag CompilerFlavor
    GHC, ([Char]
    "g", [[Char]
    "ghc"]), [Char]
    "compile with GHC")
                , (CompilerFlavor -> Last CompilerFlavor
    forall a. a -> Last a
    Flag CompilerFlavor
    GHCJS, ([], [[Char]
    "ghcjs"]), [Char]
    "compile with GHCJS")
                , (CompilerFlavor -> Last CompilerFlavor
    forall a. a -> Last a
    Flag CompilerFlavor
    UHC, ([], [[Char]
    "uhc"]), [Char]
    "compile with UHC")
                ]
            )
        , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag [Char])
    -> (Flag [Char] -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag [Char])
         (Flag [Char] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
            [Char]
    "w"
            [[Char]
    "with-compiler"]
            [Char]
    "give the path to a particular compiler"
            ConfigFlags -> Flag [Char]
    configHcPath
            (\Flag [Char]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configHcPath = v})
            ([Char]
    -> MkOptDescr
         (ConfigFlags -> Flag [Char])
         (Flag [Char] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b.
    [Char]
    -> [Char]
    -> [[Char]]
    -> [Char]
    -> (b -> Flag [Char])
    -> (Flag [Char] -> b -> b)
    -> OptDescr b
    reqArgFlag [Char]
    "PATH")
        , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag [Char])
    -> (Flag [Char] -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag [Char])
         (Flag [Char] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
            [Char]
    ""
            [[Char]
    "with-hc-pkg"]
            [Char]
    "give the path to the package tool"
            ConfigFlags -> Flag [Char]
    configHcPkg
            (\Flag [Char]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configHcPkg = v})
            ([Char]
    -> MkOptDescr
         (ConfigFlags -> Flag [Char])
         (Flag [Char] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b.
    [Char]
    -> [Char]
    -> [[Char]]
    -> [Char]
    -> (b -> Flag [Char])
    -> (Flag [Char] -> b -> b)
    -> OptDescr b
    reqArgFlag [Char]
    "PATH")
        ]
        [OptionField ConfigFlags]
    -> [OptionField ConfigFlags] -> [OptionField ConfigFlags]
    forall a. [a] -> [a] -> [a]
    ++ (OptionField (InstallDirs (Flag PathTemplate))
     -> OptionField ConfigFlags)
    -> [OptionField (InstallDirs (Flag PathTemplate))]
    -> [OptionField ConfigFlags]
    forall a b. (a -> b) -> [a] -> [b]
    map OptionField (InstallDirs (Flag PathTemplate))
    -> OptionField ConfigFlags
    liftInstallDirs [OptionField (InstallDirs (Flag PathTemplate))]
    installDirsOptions
        [OptionField ConfigFlags]
    -> [OptionField ConfigFlags] -> [OptionField ConfigFlags]
    forall a. [a] -> [a] -> [a]
    ++ [ [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag PathTemplate)
    -> (Flag PathTemplate -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag PathTemplate)
         (Flag PathTemplate -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "program-prefix"]
              [Char]
    "prefix to be applied to installed executables"
              ConfigFlags -> Flag PathTemplate
    configProgPrefix
              (\Flag PathTemplate
    v ConfigFlags
    flags -> ConfigFlags
    flags{configProgPrefix = v})
              ([Char]
    -> MkOptDescr
         (ConfigFlags -> Flag PathTemplate)
         (Flag PathTemplate -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall {t}.
    [Char]
    -> [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    reqPathTemplateArgFlag [Char]
    "PREFIX")
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag PathTemplate)
    -> (Flag PathTemplate -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag PathTemplate)
         (Flag PathTemplate -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "program-suffix"]
              [Char]
    "suffix to be applied to installed executables"
              ConfigFlags -> Flag PathTemplate
    configProgSuffix
              (\Flag PathTemplate
    v ConfigFlags
    flags -> ConfigFlags
    flags{configProgSuffix = v})
              ([Char]
    -> MkOptDescr
         (ConfigFlags -> Flag PathTemplate)
         (Flag PathTemplate -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall {t}.
    [Char]
    -> [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    reqPathTemplateArgFlag [Char]
    "SUFFIX")
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "library-vanilla"]
              [Char]
    "Vanilla libraries"
              ConfigFlags -> Flag Bool
    configVanillaLib
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configVanillaLib = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    "p"
              [[Char]
    "library-profiling"]
              [Char]
    "Library profiling"
              ConfigFlags -> Flag Bool
    configProfLib
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configProfLib = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [Char]
    "p" [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "shared"]
              [Char]
    "Shared library"
              ConfigFlags -> Flag Bool
    configSharedLib
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configSharedLib = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "static"]
              [Char]
    "Static library"
              ConfigFlags -> Flag Bool
    configStaticLib
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configStaticLib = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "executable-dynamic"]
              [Char]
    "Executable dynamic linking"
              ConfigFlags -> Flag Bool
    configDynExe
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configDynExe = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "executable-static"]
              [Char]
    "Executable fully static linking"
              ConfigFlags -> Flag Bool
    configFullyStaticExe
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configFullyStaticExe = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "profiling"]
              [Char]
    "Executable and library profiling"
              ConfigFlags -> Flag Bool
    configProf
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configProf = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "profiling-shared"]
              [Char]
    "Build profiling shared libraries"
              ConfigFlags -> Flag Bool
    configProfShared
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configProfShared = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "executable-profiling"]
              [Char]
    "Executable profiling (DEPRECATED)"
              ConfigFlags -> Flag Bool
    configProfExe
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configProfExe = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Last ProfDetailLevel)
    -> (Last ProfDetailLevel -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Last ProfDetailLevel)
         (Last ProfDetailLevel -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "profiling-detail"]
              ( [Char]
    "Profiling detail level for executable and library (default, "
                  [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "none, exported-functions, toplevel-functions,  all-functions, late)."
              )
              ConfigFlags -> Last ProfDetailLevel
    configProfDetail
              (\Last ProfDetailLevel
    v ConfigFlags
    flags -> ConfigFlags
    flags{configProfDetail = v})
              ( [Char]
    -> ([Char] -> Last ProfDetailLevel)
    -> (Last ProfDetailLevel -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> Last ProfDetailLevel)
         (Last ProfDetailLevel -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ([Char] -> b)
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg'
                  [Char]
    "level"
                  (ProfDetailLevel -> Last ProfDetailLevel
    forall a. a -> Last a
    Flag (ProfDetailLevel -> Last ProfDetailLevel)
    -> ([Char] -> ProfDetailLevel) -> [Char] -> Last ProfDetailLevel
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [Char] -> ProfDetailLevel
    flagToProfDetailLevel)
                  Last ProfDetailLevel -> [[Char]]
    showProfDetailLevelFlag
              )
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Last ProfDetailLevel)
    -> (Last ProfDetailLevel -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Last ProfDetailLevel)
         (Last ProfDetailLevel -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "library-profiling-detail"]
              [Char]
    "Profiling detail level for libraries only."
              ConfigFlags -> Last ProfDetailLevel
    configProfLibDetail
              (\Last ProfDetailLevel
    v ConfigFlags
    flags -> ConfigFlags
    flags{configProfLibDetail = v})
              ( [Char]
    -> ([Char] -> Last ProfDetailLevel)
    -> (Last ProfDetailLevel -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> Last ProfDetailLevel)
         (Last ProfDetailLevel -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ([Char] -> b)
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg'
                  [Char]
    "level"
                  (ProfDetailLevel -> Last ProfDetailLevel
    forall a. a -> Last a
    Flag (ProfDetailLevel -> Last ProfDetailLevel)
    -> ([Char] -> ProfDetailLevel) -> [Char] -> Last ProfDetailLevel
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [Char] -> ProfDetailLevel
    flagToProfDetailLevel)
                  Last ProfDetailLevel -> [[Char]]
    showProfDetailLevelFlag
              )
           , [Char]
    -> (ConfigFlags -> Last OptimisationLevel)
    -> (Last OptimisationLevel -> ConfigFlags -> ConfigFlags)
    -> [(ConfigFlags -> Last OptimisationLevel)
        -> (Last OptimisationLevel -> ConfigFlags -> ConfigFlags)
        -> OptDescr ConfigFlags]
    -> OptionField ConfigFlags
    forall get set a.
    [Char] -> get -> set -> [get -> set -> OptDescr a] -> OptionField a
    multiOption
              [Char]
    "optimization"
              ConfigFlags -> Last OptimisationLevel
    configOptimization
              (\Last OptimisationLevel
    v ConfigFlags
    flags -> ConfigFlags
    flags{configOptimization = v})
              [ [Char]
    -> ([Char], Maybe [Char] -> Last OptimisationLevel)
    -> (Last OptimisationLevel -> [Maybe [Char]])
    -> MkOptDescr
         (ConfigFlags -> Last OptimisationLevel)
         (Last OptimisationLevel -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ([Char], Maybe [Char] -> b)
    -> (b -> [Maybe [Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    optArgDef'
                  [Char]
    "n"
                  (OptimisationLevel -> [Char]
    forall a. Show a => a -> [Char]
    show OptimisationLevel
    NoOptimisation, OptimisationLevel -> Last OptimisationLevel
    forall a. a -> Last a
    Flag (OptimisationLevel -> Last OptimisationLevel)
    -> (Maybe [Char] -> OptimisationLevel)
    -> Maybe [Char]
    -> Last OptimisationLevel
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Maybe [Char] -> OptimisationLevel
    flagToOptimisationLevel)
                  ( \Last OptimisationLevel
    f -> case Last OptimisationLevel
    f of
                      Flag OptimisationLevel
    NoOptimisation -> []
                      Flag OptimisationLevel
    NormalOptimisation -> [Maybe [Char]
    forall a. Maybe a
    Nothing]
                      Flag OptimisationLevel
    MaximumOptimisation -> [[Char] -> Maybe [Char]
    forall a. a -> Maybe a
    Just [Char]
    "2"]
                      Last OptimisationLevel
    _ -> []
                  )
                  [Char]
    "O"
                  [[Char]
    "enable-optimization", [Char]
    "enable-optimisation"]
                  [Char]
    "Build with optimization (n is 0--2, default is 1)"
              , Last OptimisationLevel
    -> MkOptDescr
         (ConfigFlags -> Last OptimisationLevel)
         (Last OptimisationLevel -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a. Eq b => b -> MkOptDescr (a -> b) (b -> a -> a) a
    noArg
                  (OptimisationLevel -> Last OptimisationLevel
    forall a. a -> Last a
    Flag OptimisationLevel
    NoOptimisation)
                  []
                  [[Char]
    "disable-optimization", [Char]
    "disable-optimisation"]
                  [Char]
    "Build without optimization"
              ]
           , [Char]
    -> (ConfigFlags -> Last DebugInfoLevel)
    -> (Last DebugInfoLevel -> ConfigFlags -> ConfigFlags)
    -> [(ConfigFlags -> Last DebugInfoLevel)
        -> (Last DebugInfoLevel -> ConfigFlags -> ConfigFlags)
        -> OptDescr ConfigFlags]
    -> OptionField ConfigFlags
    forall get set a.
    [Char] -> get -> set -> [get -> set -> OptDescr a] -> OptionField a
    multiOption
              [Char]
    "debug-info"
              ConfigFlags -> Last DebugInfoLevel
    configDebugInfo
              (\Last DebugInfoLevel
    v ConfigFlags
    flags -> ConfigFlags
    flags{configDebugInfo = v})
              [ [Char]
    -> (Maybe [Char] -> Last DebugInfoLevel)
    -> (Last DebugInfoLevel -> [Maybe [Char]])
    -> MkOptDescr
         (ConfigFlags -> Last DebugInfoLevel)
         (Last DebugInfoLevel -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> (Maybe [Char] -> b)
    -> (b -> [Maybe [Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    optArg'
                  [Char]
    "n"
                  (DebugInfoLevel -> Last DebugInfoLevel
    forall a. a -> Last a
    Flag (DebugInfoLevel -> Last DebugInfoLevel)
    -> (Maybe [Char] -> DebugInfoLevel)
    -> Maybe [Char]
    -> Last DebugInfoLevel
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Maybe [Char] -> DebugInfoLevel
    flagToDebugInfoLevel)
                  ( \Last DebugInfoLevel
    f -> case Last DebugInfoLevel
    f of
                      Flag DebugInfoLevel
    NoDebugInfo -> []
                      Flag DebugInfoLevel
    MinimalDebugInfo -> [[Char] -> Maybe [Char]
    forall a. a -> Maybe a
    Just [Char]
    "1"]
                      Flag DebugInfoLevel
    NormalDebugInfo -> [Maybe [Char]
    forall a. Maybe a
    Nothing]
                      Flag DebugInfoLevel
    MaximalDebugInfo -> [[Char] -> Maybe [Char]
    forall a. a -> Maybe a
    Just [Char]
    "3"]
                      Last DebugInfoLevel
    _ -> []
                  )
                  [Char]
    ""
                  [[Char]
    "enable-debug-info"]
                  [Char]
    "Emit debug info (n is 0--3, default is 0)"
              , Last DebugInfoLevel
    -> MkOptDescr
         (ConfigFlags -> Last DebugInfoLevel)
         (Last DebugInfoLevel -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a. Eq b => b -> MkOptDescr (a -> b) (b -> a -> a) a
    noArg
                  (DebugInfoLevel -> Last DebugInfoLevel
    forall a. a -> Last a
    Flag DebugInfoLevel
    NoDebugInfo)
                  []
                  [[Char]
    "disable-debug-info"]
                  [Char]
    "Don't emit debug info"
              ]
           , [Char]
    -> (ConfigFlags -> Last DumpBuildInfo)
    -> (Last DumpBuildInfo -> ConfigFlags -> ConfigFlags)
    -> [(ConfigFlags -> Last DumpBuildInfo)
        -> (Last DumpBuildInfo -> ConfigFlags -> ConfigFlags)
        -> OptDescr ConfigFlags]
    -> OptionField ConfigFlags
    forall get set a.
    [Char] -> get -> set -> [get -> set -> OptDescr a] -> OptionField a
    multiOption
              [Char]
    "build-info"
              ConfigFlags -> Last DumpBuildInfo
    configDumpBuildInfo
              (\Last DumpBuildInfo
    v ConfigFlags
    flags -> ConfigFlags
    flags{configDumpBuildInfo = v})
              [ Last DumpBuildInfo
    -> MkOptDescr
         (ConfigFlags -> Last DumpBuildInfo)
         (Last DumpBuildInfo -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a. Eq b => b -> MkOptDescr (a -> b) (b -> a -> a) a
    noArg
                  (DumpBuildInfo -> Last DumpBuildInfo
    forall a. a -> Last a
    Flag DumpBuildInfo
    DumpBuildInfo)
                  []
                  [[Char]
    "enable-build-info"]
                  [Char]
    "Enable build information generation during project building"
              , Last DumpBuildInfo
    -> MkOptDescr
         (ConfigFlags -> Last DumpBuildInfo)
         (Last DumpBuildInfo -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a. Eq b => b -> MkOptDescr (a -> b) (b -> a -> a) a
    noArg
                  (DumpBuildInfo -> Last DumpBuildInfo
    forall a. a -> Last a
    Flag DumpBuildInfo
    NoDumpBuildInfo)
                  []
                  [[Char]
    "disable-build-info"]
                  [Char]
    "Disable build information generation during project building"
              ]
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "library-for-ghci"]
              [Char]
    "compile library for use with GHCi"
              ConfigFlags -> Flag Bool
    configGHCiLib
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configGHCiLib = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "split-sections"]
              [Char]
    "compile library code such that unneeded definitions can be dropped from the final executable (GHC 7.8+)"
              ConfigFlags -> Flag Bool
    configSplitSections
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configSplitSections = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "split-objs"]
              [Char]
    "split library into smaller objects to reduce binary sizes (GHC 6.6+)"
              ConfigFlags -> Flag Bool
    configSplitObjs
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configSplitObjs = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "executable-stripping"]
              [Char]
    "strip executables upon installation to reduce binary sizes"
              ConfigFlags -> Flag Bool
    configStripExes
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configStripExes = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "library-stripping"]
              [Char]
    "strip libraries upon installation to reduce binary sizes"
              ConfigFlags -> Flag Bool
    configStripLibs
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configStripLibs = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> [[Char]])
    -> ([[Char]] -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> [[Char]])
         ([[Char]] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "configure-option"]
              [Char]
    "Extra option for configure"
              ConfigFlags -> [[Char]]
    configConfigureArgs
              (\[[Char]]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configConfigureArgs = v})
              ([Char]
    -> ([Char] -> [[Char]])
    -> ([[Char]] -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> [[Char]])
         ([[Char]] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ([Char] -> b)
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg' [Char]
    "OPT" (\[Char]
    x -> [[Char]
    x]) [[Char]] -> [[Char]]
    forall a. a -> a
    id)
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "user-install"]
              [Char]
    "doing a per-user installation"
              ConfigFlags -> Flag Bool
    configUserInstall
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configUserInstall = v})
              (([Char], [[Char]])
    -> ([Char], [[Char]])
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    ([Char], [[Char]])
    -> ([Char], [[Char]])
    -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt' ([], [[Char]
    "user"]) ([], [[Char]
    "global"]))
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> [Maybe PackageDB])
    -> ([Maybe PackageDB] -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> [Maybe PackageDB])
         ([Maybe PackageDB] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "package-db"]
              ( [Char]
    "Append the given package database to the list of package"
                  [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " databases used (to satisfy dependencies and register into)."
                  [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " May be a specific file, 'global' or 'user'. The initial list"
                  [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " is ['global'], ['global', 'user'], or ['global', $sandbox],"
                  [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " depending on context. Use 'clear' to reset the list to empty."
                  [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " See the user guide for details."
              )
              ConfigFlags -> [Maybe PackageDB]
    configPackageDBs
              (\[Maybe PackageDB]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configPackageDBs = v})
              ([Char]
    -> ([Char] -> [Maybe PackageDB])
    -> ([Maybe PackageDB] -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> [Maybe PackageDB])
         ([Maybe PackageDB] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ([Char] -> b)
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg' [Char]
    "DB" [Char] -> [Maybe PackageDB]
    readPackageDbList [Maybe PackageDB] -> [[Char]]
    showPackageDbList)
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> FlagAssignment)
    -> (FlagAssignment -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> FlagAssignment)
         (FlagAssignment -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    "f"
              [[Char]
    "flags"]
              [Char]
    "Force values for the given flags in Cabal conditionals in the .cabal file.  E.g., --flags=\"debug -usebytestrings\" forces the flag \"debug\" to true and \"usebytestrings\" to false."
              ConfigFlags -> FlagAssignment
    configConfigurationsFlags
              (\FlagAssignment
    v ConfigFlags
    flags -> ConfigFlags
    flags{configConfigurationsFlags = v})
              ( [Char]
    -> ReadE FlagAssignment
    -> (FlagAssignment -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> FlagAssignment)
         (FlagAssignment -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ReadE b
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg
                  [Char]
    "FLAGS"
                  (ShowS -> ParsecParser FlagAssignment -> ReadE FlagAssignment
    forall a. ShowS -> ParsecParser a -> ReadE a
    parsecToReadE (\[Char]
    err -> [Char]
    "Invalid flag assignment: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    err) ParsecParser FlagAssignment
    forall (m :: * -> *). CabalParsing m => m FlagAssignment
    legacyParsecFlagAssignment)
                  FlagAssignment -> [[Char]]
    legacyShowFlagAssignment'
              )
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> [SymbolicPath Pkg ('Dir Include)])
    -> ([SymbolicPath Pkg ('Dir Include)]
        -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> [SymbolicPath Pkg ('Dir Include)])
         ([SymbolicPath Pkg ('Dir Include)] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "extra-include-dirs"]
              [Char]
    "A list of directories to search for header files"
              ConfigFlags -> [SymbolicPath Pkg ('Dir Include)]
    configExtraIncludeDirs
              (\[SymbolicPath Pkg ('Dir Include)]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configExtraIncludeDirs = v})
              ([Char]
    -> ([Char] -> [SymbolicPath Pkg ('Dir Include)])
    -> ([SymbolicPath Pkg ('Dir Include)] -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> [SymbolicPath Pkg ('Dir Include)])
         ([SymbolicPath Pkg ('Dir Include)] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ([Char] -> b)
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg' [Char]
    "PATH" (\[Char]
    x -> [[Char] -> SymbolicPath Pkg ('Dir Include)
    forall from (to :: FileOrDir). [Char] -> SymbolicPath from to
    makeSymbolicPath [Char]
    x]) ((SymbolicPath Pkg ('Dir Include) -> [Char])
    -> [SymbolicPath Pkg ('Dir Include)] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap SymbolicPath Pkg ('Dir Include) -> [Char]
    forall (allowAbsolute :: AllowAbsolute) from (to :: FileOrDir).
    SymbolicPathX allowAbsolute from to -> [Char]
    getSymbolicPath))
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "deterministic"]
              [Char]
    "Try to be as deterministic as possible (used by the test suite)"
              ConfigFlags -> Flag Bool
    configDeterministic
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configDeterministic = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag [Char])
    -> (Flag [Char] -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag [Char])
         (Flag [Char] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "ipid"]
              [Char]
    "Installed package ID to compile this package as"
              ConfigFlags -> Flag [Char]
    configIPID
              (\Flag [Char]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configIPID = v})
              ([Char]
    -> MkOptDescr
         (ConfigFlags -> Flag [Char])
         (Flag [Char] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b.
    [Char]
    -> [Char]
    -> [[Char]]
    -> [Char]
    -> (b -> Flag [Char])
    -> (Flag [Char] -> b -> b)
    -> OptDescr b
    reqArgFlag [Char]
    "IPID")
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag [Char])
    -> (Flag [Char] -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag [Char])
         (Flag [Char] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "cid"]
              [Char]
    "Installed component ID to compile this component as"
              ((ComponentId -> [Char]) -> Flag ComponentId -> Flag [Char]
    forall a b. (a -> b) -> Last a -> Last b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap ComponentId -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow (Flag ComponentId -> Flag [Char])
    -> (ConfigFlags -> Flag ComponentId) -> ConfigFlags -> Flag [Char]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ConfigFlags -> Flag ComponentId
    configCID)
              (\Flag [Char]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configCID = fmap mkComponentId v})
              ([Char]
    -> MkOptDescr
         (ConfigFlags -> Flag [Char])
         (Flag [Char] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b.
    [Char]
    -> [Char]
    -> [[Char]]
    -> [Char]
    -> (b -> Flag [Char])
    -> (Flag [Char] -> b -> b)
    -> OptDescr b
    reqArgFlag [Char]
    "CID")
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)])
    -> ([SymbolicPath Pkg ('Dir Lib)] -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)])
         ([SymbolicPath Pkg ('Dir Lib)] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "extra-lib-dirs"]
              [Char]
    "A list of directories to search for external libraries"
              ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)]
    configExtraLibDirs
              (\[SymbolicPath Pkg ('Dir Lib)]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configExtraLibDirs = v})
              ([Char]
    -> ([Char] -> [SymbolicPath Pkg ('Dir Lib)])
    -> ([SymbolicPath Pkg ('Dir Lib)] -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)])
         ([SymbolicPath Pkg ('Dir Lib)] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ([Char] -> b)
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg' [Char]
    "PATH" (\[Char]
    x -> [[Char] -> SymbolicPath Pkg ('Dir Lib)
    forall from (to :: FileOrDir). [Char] -> SymbolicPath from to
    makeSymbolicPath [Char]
    x]) ((SymbolicPath Pkg ('Dir Lib) -> [Char])
    -> [SymbolicPath Pkg ('Dir Lib)] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap SymbolicPath Pkg ('Dir Lib) -> [Char]
    forall (allowAbsolute :: AllowAbsolute) from (to :: FileOrDir).
    SymbolicPathX allowAbsolute from to -> [Char]
    getSymbolicPath))
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)])
    -> ([SymbolicPath Pkg ('Dir Lib)] -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)])
         ([SymbolicPath Pkg ('Dir Lib)] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "extra-lib-dirs-static"]
              [Char]
    "A list of directories to search for external libraries when linking fully static executables"
              ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)]
    configExtraLibDirsStatic
              (\[SymbolicPath Pkg ('Dir Lib)]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configExtraLibDirsStatic = v})
              ([Char]
    -> ([Char] -> [SymbolicPath Pkg ('Dir Lib)])
    -> ([SymbolicPath Pkg ('Dir Lib)] -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)])
         ([SymbolicPath Pkg ('Dir Lib)] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ([Char] -> b)
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg' [Char]
    "PATH" (\[Char]
    x -> [[Char] -> SymbolicPath Pkg ('Dir Lib)
    forall from (to :: FileOrDir). [Char] -> SymbolicPath from to
    makeSymbolicPath [Char]
    x]) ((SymbolicPath Pkg ('Dir Lib) -> [Char])
    -> [SymbolicPath Pkg ('Dir Lib)] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap SymbolicPath Pkg ('Dir Lib) -> [Char]
    forall (allowAbsolute :: AllowAbsolute) from (to :: FileOrDir).
    SymbolicPathX allowAbsolute from to -> [Char]
    getSymbolicPath))
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> [SymbolicPath Pkg ('Dir Framework)])
    -> ([SymbolicPath Pkg ('Dir Framework)]
        -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> [SymbolicPath Pkg ('Dir Framework)])
         ([SymbolicPath Pkg ('Dir Framework)] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "extra-framework-dirs"]
              [Char]
    "A list of directories to search for external frameworks (OS X only)"
              ConfigFlags -> [SymbolicPath Pkg ('Dir Framework)]
    configExtraFrameworkDirs
              (\[SymbolicPath Pkg ('Dir Framework)]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configExtraFrameworkDirs = v})
              ([Char]
    -> ([Char] -> [SymbolicPath Pkg ('Dir Framework)])
    -> ([SymbolicPath Pkg ('Dir Framework)] -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> [SymbolicPath Pkg ('Dir Framework)])
         ([SymbolicPath Pkg ('Dir Framework)] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ([Char] -> b)
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg' [Char]
    "PATH" (\[Char]
    x -> [[Char] -> SymbolicPath Pkg ('Dir Framework)
    forall from (to :: FileOrDir). [Char] -> SymbolicPath from to
    makeSymbolicPath [Char]
    x]) ((SymbolicPath Pkg ('Dir Framework) -> [Char])
    -> [SymbolicPath Pkg ('Dir Framework)] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap SymbolicPath Pkg ('Dir Framework) -> [Char]
    forall (allowAbsolute :: AllowAbsolute) from (to :: FileOrDir).
    SymbolicPathX allowAbsolute from to -> [Char]
    getSymbolicPath))
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> NubList [Char])
    -> (NubList [Char] -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> NubList [Char])
         (NubList [Char] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "extra-prog-path"]
              [Char]
    "A list of directories to search for required programs (in addition to the normal search locations)"
              ConfigFlags -> NubList [Char]
    configProgramPathExtra
              (\NubList [Char]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configProgramPathExtra = v})
              ([Char]
    -> ([Char] -> NubList [Char])
    -> (NubList [Char] -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> NubList [Char])
         (NubList [Char] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ([Char] -> b)
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg' [Char]
    "PATH" (\[Char]
    x -> [[Char]] -> NubList [Char]
    forall a. Ord a => [a] -> NubList a
    toNubList [[Char]
    x]) NubList [Char] -> [[Char]]
    forall a. NubList a -> [a]
    fromNubList)
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> [PackageVersionConstraint])
    -> ([PackageVersionConstraint] -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> [PackageVersionConstraint])
         ([PackageVersionConstraint] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "constraint"]
              [Char]
    "A list of additional constraints on the dependencies."
              ConfigFlags -> [PackageVersionConstraint]
    configConstraints
              (\[PackageVersionConstraint]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configConstraints = v})
              ( [Char]
    -> ReadE [PackageVersionConstraint]
    -> ([PackageVersionConstraint] -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> [PackageVersionConstraint])
         ([PackageVersionConstraint] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ReadE b
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg
                  [Char]
    "DEPENDENCY"
                  (ShowS
    -> ParsecParser [PackageVersionConstraint]
    -> ReadE [PackageVersionConstraint]
    forall a. ShowS -> ParsecParser a -> ReadE a
    parsecToReadE ([Char] -> ShowS
    forall a b. a -> b -> a
    const [Char]
    "dependency expected") ((\PackageVersionConstraint
    x -> [PackageVersionConstraint
    x]) (PackageVersionConstraint -> [PackageVersionConstraint])
    -> ParsecParser PackageVersionConstraint
    -> ParsecParser [PackageVersionConstraint]
    forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    `fmap` ParsecParser PackageVersionConstraint
    forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
    forall (m :: * -> *). CabalParsing m => m PackageVersionConstraint
    parsec))
                  ((PackageVersionConstraint -> [Char])
    -> [PackageVersionConstraint] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    map PackageVersionConstraint -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow)
              )
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> [GivenComponent])
    -> ([GivenComponent] -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> [GivenComponent])
         ([GivenComponent] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "dependency"]
              [Char]
    "A list of exact dependencies. E.g., --dependency=\"void=void-0.5.8-177d5cdf20962d0581fe2e4932a6c309\""
              ConfigFlags -> [GivenComponent]
    configDependencies
              (\[GivenComponent]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configDependencies = v})
              ( [Char]
    -> ReadE [GivenComponent]
    -> ([GivenComponent] -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> [GivenComponent])
         ([GivenComponent] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ReadE b
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg
                  [Char]
    "NAME[:COMPONENT_NAME]=CID"
                  (ShowS -> ParsecParser [GivenComponent] -> ReadE [GivenComponent]
    forall a. ShowS -> ParsecParser a -> ReadE a
    parsecToReadE ([Char] -> ShowS
    forall a b. a -> b -> a
    const [Char]
    "dependency expected") ((\GivenComponent
    x -> [GivenComponent
    x]) (GivenComponent -> [GivenComponent])
    -> ParsecParser GivenComponent -> ParsecParser [GivenComponent]
    forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    `fmap` ParsecParser GivenComponent
    parsecGivenComponent))
                  ((GivenComponent -> [Char]) -> [GivenComponent] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    map GivenComponent -> [Char]
    prettyGivenComponent)
              )
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> [PromisedComponent])
    -> ([PromisedComponent] -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> [PromisedComponent])
         ([PromisedComponent] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "promised-dependency"]
              [Char]
    "A list of promised dependencies. E.g., --promised-dependency=\"void-0.5.8=void-0.5.8-177d5cdf20962d0581fe2e4932a6c309\""
              ConfigFlags -> [PromisedComponent]
    configPromisedDependencies
              (\[PromisedComponent]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configPromisedDependencies = v})
              ( [Char]
    -> ReadE [PromisedComponent]
    -> ([PromisedComponent] -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> [PromisedComponent])
         ([PromisedComponent] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ReadE b
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg
                  [Char]
    "NAME-VER[:COMPONENT_NAME]=CID"
                  (ShowS
    -> ParsecParser [PromisedComponent] -> ReadE [PromisedComponent]
    forall a. ShowS -> ParsecParser a -> ReadE a
    parsecToReadE ([Char] -> ShowS
    forall a b. a -> b -> a
    const [Char]
    "dependency expected") ((\PromisedComponent
    x -> [PromisedComponent
    x]) (PromisedComponent -> [PromisedComponent])
    -> ParsecParser PromisedComponent
    -> ParsecParser [PromisedComponent]
    forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    `fmap` ParsecParser PromisedComponent
    parsecPromisedComponent))
                  ((PromisedComponent -> [Char]) -> [PromisedComponent] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    map PromisedComponent -> [Char]
    prettyPromisedComponent)
              )
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> [(ModuleName, Module)])
    -> ([(ModuleName, Module)] -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> [(ModuleName, Module)])
         ([(ModuleName, Module)] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "instantiate-with"]
              [Char]
    "A mapping of signature names to concrete module instantiations."
              ConfigFlags -> [(ModuleName, Module)]
    configInstantiateWith
              (\[(ModuleName, Module)]
    v ConfigFlags
    flags -> ConfigFlags
    flags{configInstantiateWith = v})
              ( [Char]
    -> ReadE [(ModuleName, Module)]
    -> ([(ModuleName, Module)] -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> [(ModuleName, Module)])
         ([(ModuleName, Module)] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ReadE b
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg
                  [Char]
    "NAME=MOD"
                  (ShowS
    -> ParsecParser [(ModuleName, Module)]
    -> ReadE [(ModuleName, Module)]
    forall a. ShowS -> ParsecParser a -> ReadE a
    parsecToReadE ([Char]
    "Cannot parse module substitution: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++) (((ModuleName, Module) -> [(ModuleName, Module)])
    -> ParsecParser (ModuleName, Module)
    -> ParsecParser [(ModuleName, Module)]
    forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap ((ModuleName, Module)
    -> [(ModuleName, Module)] -> [(ModuleName, Module)]
    forall a. a -> [a] -> [a]
    : []) ParsecParser (ModuleName, Module)
    parsecModSubstEntry))
                  (((ModuleName, Module) -> [Char])
    -> [(ModuleName, Module)] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    map (Style -> Doc -> [Char]
    Disp.renderStyle Style
    defaultStyle (Doc -> [Char])
    -> ((ModuleName, Module) -> Doc) -> (ModuleName, Module) -> [Char]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (ModuleName, Module) -> Doc
    dispModSubstEntry))
              )
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "tests"]
              [Char]
    "dependency checking and compilation for test suites listed in the package description file."
              ConfigFlags -> Flag Bool
    configTests
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configTests = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "coverage"]
              [Char]
    "build package with Haskell Program Coverage. (GHC only)"
              ConfigFlags -> Flag Bool
    configCoverage
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configCoverage = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "library-coverage"]
              [Char]
    "build package with Haskell Program Coverage. (GHC only) (DEPRECATED)"
              ConfigFlags -> Flag Bool
    configLibCoverage
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configLibCoverage = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "exact-configuration"]
              [Char]
    "All direct dependencies and flags are provided on the command line."
              ConfigFlags -> Flag Bool
    configExactConfiguration
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configExactConfiguration = v})
              MkOptDescr
      (ConfigFlags -> Flag Bool)
      (Flag Bool -> ConfigFlags -> ConfigFlags)
      ConfigFlags
    forall a. MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    trueArg
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "benchmarks"]
              [Char]
    "dependency checking and compilation for benchmarks listed in the package description file."
              ConfigFlags -> Flag Bool
    configBenchmarks
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configBenchmarks = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "relocatable"]
              [Char]
    "building a package that is relocatable. (GHC only)"
              ConfigFlags -> Flag Bool
    configRelocatable
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configRelocatable = v})
              ([Char]
    -> [Char]
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    [Char]
    -> [Char] -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt [] [])
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "response-files"]
              [Char]
    "enable workaround for old versions of programs like \"ar\" that do not support @file arguments"
              ConfigFlags -> Flag Bool
    configUseResponseFiles
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configUseResponseFiles = v})
              (([Char], [[Char]])
    -> ([Char], [[Char]])
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall a.
    ([Char], [[Char]])
    -> ([Char], [[Char]])
    -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    boolOpt' ([], [[Char]
    "disable-response-files"]) ([], []))
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "allow-depending-on-private-libs"]
              ( [Char]
    "Allow depending on private libraries. "
                  [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "If set, the library visibility check MUST be done externally."
              )
              ConfigFlags -> Flag Bool
    configAllowDependingOnPrivateLibs
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configAllowDependingOnPrivateLibs = v})
              MkOptDescr
      (ConfigFlags -> Flag Bool)
      (Flag Bool -> ConfigFlags -> ConfigFlags)
      ConfigFlags
    forall a. MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    trueArg
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Last [UnitId])
    -> (Last [UnitId] -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Last [UnitId])
         (Last [UnitId] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "coverage-for"]
              [Char]
    "A list of unit-ids of libraries to include in the Haskell Program Coverage report."
              ConfigFlags -> Last [UnitId]
    configCoverageFor
              ( \Last [UnitId]
    v ConfigFlags
    flags ->
                  ConfigFlags
    flags
                    { configCoverageFor =
                        mergeListFlag (configCoverageFor flags) v
                    }
              )
              ( [Char]
    -> ([Char] -> Last [UnitId])
    -> (Last [UnitId] -> [[Char]])
    -> MkOptDescr
         (ConfigFlags -> Last [UnitId])
         (Last [UnitId] -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    forall b a.
    Monoid b =>
    [Char]
    -> ([Char] -> b)
    -> (b -> [[Char]])
    -> MkOptDescr (a -> b) (b -> a -> a) a
    reqArg'
                  [Char]
    "UNITID"
                  ([UnitId] -> Last [UnitId]
    forall a. a -> Last a
    Flag ([UnitId] -> Last [UnitId])
    -> ([Char] -> [UnitId]) -> [Char] -> Last [UnitId]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (UnitId -> [UnitId] -> [UnitId]
    forall a. a -> [a] -> [a]
    : []) (UnitId -> [UnitId]) -> ([Char] -> UnitId) -> [Char] -> [UnitId]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [Char] -> UnitId
    forall a. IsString a => [Char] -> a
    fromString)
                  ((UnitId -> [Char]) -> [UnitId] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap UnitId -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow ([UnitId] -> [[Char]])
    -> (Last [UnitId] -> [UnitId]) -> Last [UnitId] -> [[Char]]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [UnitId] -> Last [UnitId] -> [UnitId]
    forall a. a -> Flag a -> a
    fromFlagOrDefault [])
              )
           , [Char]
    -> [[Char]]
    -> [Char]
    -> (ConfigFlags -> Flag Bool)
    -> (Flag Bool -> ConfigFlags -> ConfigFlags)
    -> MkOptDescr
         (ConfigFlags -> Flag Bool)
         (Flag Bool -> ConfigFlags -> ConfigFlags)
         ConfigFlags
    -> OptionField ConfigFlags
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
              [Char]
    ""
              [[Char]
    "ignore-build-tools"]
              ( [Char]
    "Ignore build tool dependencies. "
                  [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "If set, declared build tools needn't be found for compilation to proceed."
              )
              ConfigFlags -> Flag Bool
    configIgnoreBuildTools
              (\Flag Bool
    v ConfigFlags
    flags -> ConfigFlags
    flags{configIgnoreBuildTools = v})
              MkOptDescr
      (ConfigFlags -> Flag Bool)
      (Flag Bool -> ConfigFlags -> ConfigFlags)
      ConfigFlags
    forall a. MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
    trueArg
           ]
      where
        liftInstallDirs :: OptionField (InstallDirs (Flag PathTemplate))
    -> OptionField ConfigFlags
    liftInstallDirs =
          (ConfigFlags -> InstallDirs (Flag PathTemplate))
    -> (InstallDirs (Flag PathTemplate) -> ConfigFlags -> ConfigFlags)
    -> OptionField (InstallDirs (Flag PathTemplate))
    -> OptionField ConfigFlags
    forall b a.
    (b -> a) -> (a -> b -> b) -> OptionField a -> OptionField b
    liftOption ConfigFlags -> InstallDirs (Flag PathTemplate)
    configInstallDirs (\InstallDirs (Flag PathTemplate)
    v ConfigFlags
    flags -> ConfigFlags
    flags{configInstallDirs = v})

        reqPathTemplateArgFlag :: [Char]
    -> [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    reqPathTemplateArgFlag [Char]
    title [Char]
    _sf [[Char]]
    _lf [Char]
    d t -> Flag PathTemplate
    get Flag PathTemplate -> t -> t
    set =
          [Char]
    -> [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag [Char])
    -> (Flag [Char] -> t -> t)
    -> OptDescr t
    forall b.
    [Char]
    -> [Char]
    -> [[Char]]
    -> [Char]
    -> (b -> Flag [Char])
    -> (Flag [Char] -> b -> b)
    -> OptDescr b
    reqArgFlag
            [Char]
    title
            [Char]
    _sf
            [[Char]]
    _lf
            [Char]
    d
            ((PathTemplate -> [Char]) -> Flag PathTemplate -> Flag [Char]
    forall a b. (a -> b) -> Last a -> Last b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap PathTemplate -> [Char]
    fromPathTemplate (Flag PathTemplate -> Flag [Char])
    -> (t -> Flag PathTemplate) -> t -> Flag [Char]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . t -> Flag PathTemplate
    get)
            (Flag PathTemplate -> t -> t
    set (Flag PathTemplate -> t -> t)
    -> (Flag [Char] -> Flag PathTemplate) -> Flag [Char] -> t -> t
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ([Char] -> PathTemplate) -> Flag [Char] -> Flag PathTemplate
    forall a b. (a -> b) -> Last a -> Last b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap [Char] -> PathTemplate
    toPathTemplate)

    readPackageDbList :: String -> [Maybe PackageDB]
    readPackageDbList :: [Char] -> [Maybe PackageDB]
    readPackageDbList [Char]
    str = [[Char] -> Maybe PackageDB
    readPackageDb [Char]
    str]

    -- | Parse a PackageDB stack entry
    --
    -- @since 3.7.0.0
    readPackageDb :: String -> Maybe PackageDB
    readPackageDb :: [Char] -> Maybe PackageDB
    readPackageDb [Char]
    "clear" = Maybe PackageDB
    forall a. Maybe a
    Nothing
    readPackageDb [Char]
    "global" = PackageDB -> Maybe PackageDB
    forall a. a -> Maybe a
    Just PackageDB
    forall fp. PackageDBX fp
    GlobalPackageDB
    readPackageDb [Char]
    "user" = PackageDB -> Maybe PackageDB
    forall a. a -> Maybe a
    Just PackageDB
    forall fp. PackageDBX fp
    UserPackageDB
    readPackageDb [Char]
    other = PackageDB -> Maybe PackageDB
    forall a. a -> Maybe a
    Just (SymbolicPathX 'AllowAbsolute Pkg ('Dir PkgDB) -> PackageDB
    forall fp. fp -> PackageDBX fp
    SpecificPackageDB ([Char] -> SymbolicPathX 'AllowAbsolute Pkg ('Dir PkgDB)
    forall from (to :: FileOrDir). [Char] -> SymbolicPath from to
    makeSymbolicPath [Char]
    other))

    showPackageDbList :: [Maybe PackageDB] -> [String]
    showPackageDbList :: [Maybe PackageDB] -> [[Char]]
    showPackageDbList = (Maybe PackageDB -> [Char]) -> [Maybe PackageDB] -> [[Char]]
    forall a b. (a -> b) -> [a] -> [b]
    map Maybe PackageDB -> [Char]
    showPackageDb

    -- | Show a PackageDB stack entry
    --
    -- @since 3.7.0.0
    showPackageDb :: Maybe PackageDB -> String
    showPackageDb :: Maybe PackageDB -> [Char]
    showPackageDb Maybe PackageDB
    Nothing = [Char]
    "clear"
    showPackageDb (Just PackageDB
    GlobalPackageDB) = [Char]
    "global"
    showPackageDb (Just PackageDB
    UserPackageDB) = [Char]
    "user"
    showPackageDb (Just (SpecificPackageDB SymbolicPathX 'AllowAbsolute Pkg ('Dir PkgDB)
    db)) = SymbolicPathX 'AllowAbsolute Pkg ('Dir PkgDB) -> [Char]
    forall (allowAbsolute :: AllowAbsolute) from (to :: FileOrDir).
    SymbolicPathX allowAbsolute from to -> [Char]
    getSymbolicPath SymbolicPathX 'AllowAbsolute Pkg ('Dir PkgDB)
    db

    showProfDetailLevelFlag :: Flag ProfDetailLevel -> [String]
    showProfDetailLevelFlag :: Last ProfDetailLevel -> [[Char]]
    showProfDetailLevelFlag Last ProfDetailLevel
    NoFlag = []
    showProfDetailLevelFlag (Flag ProfDetailLevel
    dl) = [ProfDetailLevel -> [Char]
    showProfDetailLevel ProfDetailLevel
    dl]

    parsecPromisedComponent :: ParsecParser PromisedComponent
    parsecPromisedComponent :: ParsecParser PromisedComponent
    parsecPromisedComponent = do
      pn <- ParsecParser PackageIdentifier
    forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
    forall (m :: * -> *). CabalParsing m => m PackageIdentifier
    parsec
      ln <- P.option LMainLibName $ do
        _ <- P.char ':'
        ucn <- parsec
        return $
          if unUnqualComponentName ucn == unPackageName (pkgName pn)
            then LMainLibName
            else LSubLibName ucn
      _ <- P.char '='
      cid <- parsec
      return $ PromisedComponent pn ln cid

    prettyPromisedComponent :: PromisedComponent -> String
    prettyPromisedComponent :: PromisedComponent -> [Char]
    prettyPromisedComponent (PromisedComponent PackageIdentifier
    pn LibraryName
    cn ComponentId
    cid) =
      PackageIdentifier -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow PackageIdentifier
    pn
        [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ case LibraryName
    cn of
          LibraryName
    LMainLibName -> [Char]
    ""
          LSubLibName UnqualComponentName
    n -> [Char]
    ":" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ UnqualComponentName -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow UnqualComponentName
    n
        [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "="
        [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ ComponentId -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow ComponentId
    cid

    parsecGivenComponent :: ParsecParser GivenComponent
    parsecGivenComponent :: ParsecParser GivenComponent
    parsecGivenComponent = do
      pn <- ParsecParser PackageName
    forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
    forall (m :: * -> *). CabalParsing m => m PackageName
    parsec
      ln <- P.option LMainLibName $ do
        _ <- P.char ':'
        ucn <- parsec
        return $
          if unUnqualComponentName ucn == unPackageName pn
            then LMainLibName
            else LSubLibName ucn
      _ <- P.char '='
      cid <- parsec
      return $ GivenComponent pn ln cid

    prettyGivenComponent :: GivenComponent -> String
    prettyGivenComponent :: GivenComponent -> [Char]
    prettyGivenComponent (GivenComponent PackageName
    pn LibraryName
    cn ComponentId
    cid) =
      PackageName -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow PackageName
    pn
        [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ case LibraryName
    cn of
          LibraryName
    LMainLibName -> [Char]
    ""
          LSubLibName UnqualComponentName
    n -> [Char]
    ":" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ UnqualComponentName -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow UnqualComponentName
    n
        [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "="
        [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ ComponentId -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow ComponentId
    cid

    installDirsOptions :: [OptionField (InstallDirs (Flag PathTemplate))]
    installDirsOptions :: [OptionField (InstallDirs (Flag PathTemplate))]
    installDirsOptions =
      [ [Char]
    -> [[Char]]
    -> [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> (Flag PathTemplate
        -> InstallDirs (Flag PathTemplate)
        -> InstallDirs (Flag PathTemplate))
    -> MkOptDescr
         (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
         (Flag PathTemplate
          -> InstallDirs (Flag PathTemplate)
          -> InstallDirs (Flag PathTemplate))
         (InstallDirs (Flag PathTemplate))
    -> OptionField (InstallDirs (Flag PathTemplate))
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
          [Char]
    ""
          [[Char]
    "prefix"]
          [Char]
    "bake this prefix in preparation of installation"
          InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    prefix
          (\Flag PathTemplate
    v InstallDirs (Flag PathTemplate)
    flags -> InstallDirs (Flag PathTemplate)
    flags{prefix = v})
          MkOptDescr
      (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
      (Flag PathTemplate
       -> InstallDirs (Flag PathTemplate)
       -> InstallDirs (Flag PathTemplate))
      (InstallDirs (Flag PathTemplate))
    forall {t}.
    [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    installDirArg
      , [Char]
    -> [[Char]]
    -> [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> (Flag PathTemplate
        -> InstallDirs (Flag PathTemplate)
        -> InstallDirs (Flag PathTemplate))
    -> MkOptDescr
         (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
         (Flag PathTemplate
          -> InstallDirs (Flag PathTemplate)
          -> InstallDirs (Flag PathTemplate))
         (InstallDirs (Flag PathTemplate))
    -> OptionField (InstallDirs (Flag PathTemplate))
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
          [Char]
    ""
          [[Char]
    "bindir"]
          [Char]
    "installation directory for executables"
          InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    bindir
          (\Flag PathTemplate
    v InstallDirs (Flag PathTemplate)
    flags -> InstallDirs (Flag PathTemplate)
    flags{bindir = v})
          MkOptDescr
      (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
      (Flag PathTemplate
       -> InstallDirs (Flag PathTemplate)
       -> InstallDirs (Flag PathTemplate))
      (InstallDirs (Flag PathTemplate))
    forall {t}.
    [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    installDirArg
      , [Char]
    -> [[Char]]
    -> [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> (Flag PathTemplate
        -> InstallDirs (Flag PathTemplate)
        -> InstallDirs (Flag PathTemplate))
    -> MkOptDescr
         (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
         (Flag PathTemplate
          -> InstallDirs (Flag PathTemplate)
          -> InstallDirs (Flag PathTemplate))
         (InstallDirs (Flag PathTemplate))
    -> OptionField (InstallDirs (Flag PathTemplate))
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
          [Char]
    ""
          [[Char]
    "libdir"]
          [Char]
    "installation directory for libraries"
          InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    libdir
          (\Flag PathTemplate
    v InstallDirs (Flag PathTemplate)
    flags -> InstallDirs (Flag PathTemplate)
    flags{libdir = v})
          MkOptDescr
      (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
      (Flag PathTemplate
       -> InstallDirs (Flag PathTemplate)
       -> InstallDirs (Flag PathTemplate))
      (InstallDirs (Flag PathTemplate))
    forall {t}.
    [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    installDirArg
      , [Char]
    -> [[Char]]
    -> [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> (Flag PathTemplate
        -> InstallDirs (Flag PathTemplate)
        -> InstallDirs (Flag PathTemplate))
    -> MkOptDescr
         (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
         (Flag PathTemplate
          -> InstallDirs (Flag PathTemplate)
          -> InstallDirs (Flag PathTemplate))
         (InstallDirs (Flag PathTemplate))
    -> OptionField (InstallDirs (Flag PathTemplate))
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
          [Char]
    ""
          [[Char]
    "libsubdir"]
          [Char]
    "subdirectory of libdir in which libs are installed"
          InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    libsubdir
          (\Flag PathTemplate
    v InstallDirs (Flag PathTemplate)
    flags -> InstallDirs (Flag PathTemplate)
    flags{libsubdir = v})
          MkOptDescr
      (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
      (Flag PathTemplate
       -> InstallDirs (Flag PathTemplate)
       -> InstallDirs (Flag PathTemplate))
      (InstallDirs (Flag PathTemplate))
    forall {t}.
    [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    installDirArg
      , [Char]
    -> [[Char]]
    -> [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> (Flag PathTemplate
        -> InstallDirs (Flag PathTemplate)
        -> InstallDirs (Flag PathTemplate))
    -> MkOptDescr
         (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
         (Flag PathTemplate
          -> InstallDirs (Flag PathTemplate)
          -> InstallDirs (Flag PathTemplate))
         (InstallDirs (Flag PathTemplate))
    -> OptionField (InstallDirs (Flag PathTemplate))
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
          [Char]
    ""
          [[Char]
    "dynlibdir"]
          [Char]
    "installation directory for dynamic libraries"
          InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    dynlibdir
          (\Flag PathTemplate
    v InstallDirs (Flag PathTemplate)
    flags -> InstallDirs (Flag PathTemplate)
    flags{dynlibdir = v})
          MkOptDescr
      (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
      (Flag PathTemplate
       -> InstallDirs (Flag PathTemplate)
       -> InstallDirs (Flag PathTemplate))
      (InstallDirs (Flag PathTemplate))
    forall {t}.
    [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    installDirArg
      , [Char]
    -> [[Char]]
    -> [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> (Flag PathTemplate
        -> InstallDirs (Flag PathTemplate)
        -> InstallDirs (Flag PathTemplate))
    -> MkOptDescr
         (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
         (Flag PathTemplate
          -> InstallDirs (Flag PathTemplate)
          -> InstallDirs (Flag PathTemplate))
         (InstallDirs (Flag PathTemplate))
    -> OptionField (InstallDirs (Flag PathTemplate))
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
          [Char]
    ""
          [[Char]
    "libexecdir"]
          [Char]
    "installation directory for program executables"
          InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    libexecdir
          (\Flag PathTemplate
    v InstallDirs (Flag PathTemplate)
    flags -> InstallDirs (Flag PathTemplate)
    flags{libexecdir = v})
          MkOptDescr
      (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
      (Flag PathTemplate
       -> InstallDirs (Flag PathTemplate)
       -> InstallDirs (Flag PathTemplate))
      (InstallDirs (Flag PathTemplate))
    forall {t}.
    [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    installDirArg
      , [Char]
    -> [[Char]]
    -> [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> (Flag PathTemplate
        -> InstallDirs (Flag PathTemplate)
        -> InstallDirs (Flag PathTemplate))
    -> MkOptDescr
         (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
         (Flag PathTemplate
          -> InstallDirs (Flag PathTemplate)
          -> InstallDirs (Flag PathTemplate))
         (InstallDirs (Flag PathTemplate))
    -> OptionField (InstallDirs (Flag PathTemplate))
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
          [Char]
    ""
          [[Char]
    "libexecsubdir"]
          [Char]
    "subdirectory of libexecdir in which private executables are installed"
          InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    libexecsubdir
          (\Flag PathTemplate
    v InstallDirs (Flag PathTemplate)
    flags -> InstallDirs (Flag PathTemplate)
    flags{libexecsubdir = v})
          MkOptDescr
      (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
      (Flag PathTemplate
       -> InstallDirs (Flag PathTemplate)
       -> InstallDirs (Flag PathTemplate))
      (InstallDirs (Flag PathTemplate))
    forall {t}.
    [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    installDirArg
      , [Char]
    -> [[Char]]
    -> [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> (Flag PathTemplate
        -> InstallDirs (Flag PathTemplate)
        -> InstallDirs (Flag PathTemplate))
    -> MkOptDescr
         (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
         (Flag PathTemplate
          -> InstallDirs (Flag PathTemplate)
          -> InstallDirs (Flag PathTemplate))
         (InstallDirs (Flag PathTemplate))
    -> OptionField (InstallDirs (Flag PathTemplate))
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
          [Char]
    ""
          [[Char]
    "datadir"]
          [Char]
    "installation directory for read-only data"
          InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    datadir
          (\Flag PathTemplate
    v InstallDirs (Flag PathTemplate)
    flags -> InstallDirs (Flag PathTemplate)
    flags{datadir = v})
          MkOptDescr
      (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
      (Flag PathTemplate
       -> InstallDirs (Flag PathTemplate)
       -> InstallDirs (Flag PathTemplate))
      (InstallDirs (Flag PathTemplate))
    forall {t}.
    [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    installDirArg
      , [Char]
    -> [[Char]]
    -> [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> (Flag PathTemplate
        -> InstallDirs (Flag PathTemplate)
        -> InstallDirs (Flag PathTemplate))
    -> MkOptDescr
         (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
         (Flag PathTemplate
          -> InstallDirs (Flag PathTemplate)
          -> InstallDirs (Flag PathTemplate))
         (InstallDirs (Flag PathTemplate))
    -> OptionField (InstallDirs (Flag PathTemplate))
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
          [Char]
    ""
          [[Char]
    "datasubdir"]
          [Char]
    "subdirectory of datadir in which data files are installed"
          InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    datasubdir
          (\Flag PathTemplate
    v InstallDirs (Flag PathTemplate)
    flags -> InstallDirs (Flag PathTemplate)
    flags{datasubdir = v})
          MkOptDescr
      (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
      (Flag PathTemplate
       -> InstallDirs (Flag PathTemplate)
       -> InstallDirs (Flag PathTemplate))
      (InstallDirs (Flag PathTemplate))
    forall {t}.
    [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    installDirArg
      , [Char]
    -> [[Char]]
    -> [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> (Flag PathTemplate
        -> InstallDirs (Flag PathTemplate)
        -> InstallDirs (Flag PathTemplate))
    -> MkOptDescr
         (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
         (Flag PathTemplate
          -> InstallDirs (Flag PathTemplate)
          -> InstallDirs (Flag PathTemplate))
         (InstallDirs (Flag PathTemplate))
    -> OptionField (InstallDirs (Flag PathTemplate))
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
          [Char]
    ""
          [[Char]
    "docdir"]
          [Char]
    "installation directory for documentation"
          InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    docdir
          (\Flag PathTemplate
    v InstallDirs (Flag PathTemplate)
    flags -> InstallDirs (Flag PathTemplate)
    flags{docdir = v})
          MkOptDescr
      (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
      (Flag PathTemplate
       -> InstallDirs (Flag PathTemplate)
       -> InstallDirs (Flag PathTemplate))
      (InstallDirs (Flag PathTemplate))
    forall {t}.
    [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    installDirArg
      , [Char]
    -> [[Char]]
    -> [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> (Flag PathTemplate
        -> InstallDirs (Flag PathTemplate)
        -> InstallDirs (Flag PathTemplate))
    -> MkOptDescr
         (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
         (Flag PathTemplate
          -> InstallDirs (Flag PathTemplate)
          -> InstallDirs (Flag PathTemplate))
         (InstallDirs (Flag PathTemplate))
    -> OptionField (InstallDirs (Flag PathTemplate))
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
          [Char]
    ""
          [[Char]
    "htmldir"]
          [Char]
    "installation directory for HTML documentation"
          InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    htmldir
          (\Flag PathTemplate
    v InstallDirs (Flag PathTemplate)
    flags -> InstallDirs (Flag PathTemplate)
    flags{htmldir = v})
          MkOptDescr
      (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
      (Flag PathTemplate
       -> InstallDirs (Flag PathTemplate)
       -> InstallDirs (Flag PathTemplate))
      (InstallDirs (Flag PathTemplate))
    forall {t}.
    [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    installDirArg
      , [Char]
    -> [[Char]]
    -> [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> (Flag PathTemplate
        -> InstallDirs (Flag PathTemplate)
        -> InstallDirs (Flag PathTemplate))
    -> MkOptDescr
         (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
         (Flag PathTemplate
          -> InstallDirs (Flag PathTemplate)
          -> InstallDirs (Flag PathTemplate))
         (InstallDirs (Flag PathTemplate))
    -> OptionField (InstallDirs (Flag PathTemplate))
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
          [Char]
    ""
          [[Char]
    "haddockdir"]
          [Char]
    "installation directory for haddock interfaces"
          InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    haddockdir
          (\Flag PathTemplate
    v InstallDirs (Flag PathTemplate)
    flags -> InstallDirs (Flag PathTemplate)
    flags{haddockdir = v})
          MkOptDescr
      (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
      (Flag PathTemplate
       -> InstallDirs (Flag PathTemplate)
       -> InstallDirs (Flag PathTemplate))
      (InstallDirs (Flag PathTemplate))
    forall {t}.
    [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    installDirArg
      , [Char]
    -> [[Char]]
    -> [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> (Flag PathTemplate
        -> InstallDirs (Flag PathTemplate)
        -> InstallDirs (Flag PathTemplate))
    -> MkOptDescr
         (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
         (Flag PathTemplate
          -> InstallDirs (Flag PathTemplate)
          -> InstallDirs (Flag PathTemplate))
         (InstallDirs (Flag PathTemplate))
    -> OptionField (InstallDirs (Flag PathTemplate))
    forall get set a.
    [Char]
    -> [[Char]]
    -> [Char]
    -> get
    -> set
    -> MkOptDescr get set a
    -> OptionField a
    option
          [Char]
    ""
          [[Char]
    "sysconfdir"]
          [Char]
    "installation directory for configuration files"
          InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    sysconfdir
          (\Flag PathTemplate
    v InstallDirs (Flag PathTemplate)
    flags -> InstallDirs (Flag PathTemplate)
    flags{sysconfdir = v})
          MkOptDescr
      (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
      (Flag PathTemplate
       -> InstallDirs (Flag PathTemplate)
       -> InstallDirs (Flag PathTemplate))
      (InstallDirs (Flag PathTemplate))
    forall {t}.
    [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    installDirArg
      ]
      where
        installDirArg :: [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag PathTemplate)
    -> (Flag PathTemplate -> t -> t)
    -> OptDescr t
    installDirArg [Char]
    _sf [[Char]]
    _lf [Char]
    d t -> Flag PathTemplate
    get Flag PathTemplate -> t -> t
    set =
          [Char]
    -> [Char]
    -> [[Char]]
    -> [Char]
    -> (t -> Flag [Char])
    -> (Flag [Char] -> t -> t)
    -> OptDescr t
    forall b.
    [Char]
    -> [Char]
    -> [[Char]]
    -> [Char]
    -> (b -> Flag [Char])
    -> (Flag [Char] -> b -> b)
    -> OptDescr b
    reqArgFlag
            [Char]
    "DIR"
            [Char]
    _sf
            [[Char]]
    _lf
            [Char]
    d
            ((PathTemplate -> [Char]) -> Flag PathTemplate -> Flag [Char]
    forall a b. (a -> b) -> Last a -> Last b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap PathTemplate -> [Char]
    fromPathTemplate (Flag PathTemplate -> Flag [Char])
    -> (t -> Flag PathTemplate) -> t -> Flag [Char]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . t -> Flag PathTemplate
    get)
            (Flag PathTemplate -> t -> t
    set (Flag PathTemplate -> t -> t)
    -> (Flag [Char] -> Flag PathTemplate) -> Flag [Char] -> t -> t
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ([Char] -> PathTemplate) -> Flag [Char] -> Flag PathTemplate
    forall a b. (a -> b) -> Last a -> Last b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap [Char] -> PathTemplate
    toPathTemplate)

    emptyConfigFlags :: ConfigFlags
    emptyConfigFlags :: ConfigFlags
    emptyConfigFlags = ConfigFlags
    forall a. Monoid a => a
    mempty

    instance Monoid ConfigFlags where
      mempty :: ConfigFlags
    mempty = ConfigFlags
    forall a. (Generic a, GMonoid (Rep a)) => a
    gmempty
      mappend :: ConfigFlags -> ConfigFlags -> ConfigFlags
    mappend = ConfigFlags -> ConfigFlags -> ConfigFlags
    forall a. Semigroup a => a -> a -> a
    (<>)

    instance Semigroup ConfigFlags where
      <> :: ConfigFlags -> ConfigFlags -> ConfigFlags
    (<>) = ConfigFlags -> ConfigFlags -> ConfigFlags
    forall a. (Generic a, GSemigroup (Rep a)) => a -> a -> a
    gmappend

    -- | Arguments to pass to a @configure@ script, e.g. generated by
    -- @autoconf@.
    configureArgs :: Bool -> ConfigFlags -> [String]
    configureArgs :: Bool -> ConfigFlags -> [[Char]]
    configureArgs Bool
    bcHack ConfigFlags
    flags =
      [[Char]]
    hc_flag
        [[Char]] -> [[Char]] -> [[Char]]
    forall a. [a] -> [a] -> [a]
    ++ [Char] -> (ConfigFlags -> Flag [Char]) -> [[Char]]
    optFlag [Char]
    "with-hc-pkg" ConfigFlags -> Flag [Char]
    configHcPkg
        [[Char]] -> [[Char]] -> [[Char]]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> [[Char]]
    optFlag' [Char]
    "prefix" InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    prefix
        [[Char]] -> [[Char]] -> [[Char]]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> [[Char]]
    optFlag' [Char]
    "bindir" InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    bindir
        [[Char]] -> [[Char]] -> [[Char]]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> [[Char]]
    optFlag' [Char]
    "libdir" InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    libdir
        [[Char]] -> [[Char]] -> [[Char]]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> [[Char]]
    optFlag' [Char]
    "libexecdir" InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    libexecdir
        [[Char]] -> [[Char]] -> [[Char]]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> [[Char]]
    optFlag' [Char]
    "datadir" InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    datadir
        [[Char]] -> [[Char]] -> [[Char]]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> [[Char]]
    optFlag' [Char]
    "sysconfdir" InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    forall dir. InstallDirs dir -> dir
    sysconfdir
        [[Char]] -> [[Char]] -> [[Char]]
    forall a. [a] -> [a] -> [a]
    ++ ConfigFlags -> [[Char]]
    configConfigureArgs ConfigFlags
    flags
      where
        hc_flag :: [[Char]]
    hc_flag = case (ConfigFlags -> Last CompilerFlavor
    configHcFlavor ConfigFlags
    flags, ConfigFlags -> Flag [Char]
    configHcPath ConfigFlags
    flags) of
          (Last CompilerFlavor
    _, Flag [Char]
    hc_path) -> [[Char]
    hc_flag_name [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    hc_path]
          (Flag CompilerFlavor
    hc, Flag [Char]
    NoFlag) -> [[Char]
    hc_flag_name [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ CompilerFlavor -> [Char]
    forall a. Pretty a => a -> [Char]
    prettyShow CompilerFlavor
    hc]
          (Last CompilerFlavor
    NoFlag, Flag [Char]
    NoFlag) -> []
        hc_flag_name :: [Char]
    hc_flag_name
          -- TODO kill off this bc hack when defaultUserHooks is removed.
          | Bool
    bcHack = [Char]
    "--with-hc="
          | Bool
    otherwise = [Char]
    "--with-compiler="
        optFlag :: [Char] -> (ConfigFlags -> Flag [Char]) -> [[Char]]
    optFlag [Char]
    name ConfigFlags -> Flag [Char]
    config_field = case ConfigFlags -> Flag [Char]
    config_field ConfigFlags
    flags of
          Flag [Char]
    p -> [[Char]
    "--" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    name [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    "=" [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    p]
          Flag [Char]
    NoFlag -> []
        optFlag' :: [Char]
    -> (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> [[Char]]
    optFlag' [Char]
    name InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    config_field =
          [Char] -> (ConfigFlags -> Flag [Char]) -> [[Char]]
    optFlag
            [Char]
    name
            ( (PathTemplate -> [Char]) -> Flag PathTemplate -> Flag [Char]
    forall a b. (a -> b) -> Last a -> Last b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap PathTemplate -> [Char]
    fromPathTemplate
                (Flag PathTemplate -> Flag [Char])
    -> (ConfigFlags -> Flag PathTemplate) -> ConfigFlags -> Flag [Char]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . InstallDirs (Flag PathTemplate) -> Flag PathTemplate
    config_field
                (InstallDirs (Flag PathTemplate) -> Flag PathTemplate)
    -> (ConfigFlags -> InstallDirs (Flag PathTemplate))
    -> ConfigFlags
    -> Flag PathTemplate
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ConfigFlags -> InstallDirs (Flag PathTemplate)
    configInstallDirs
            )