Copyright | Isaac Jones 2003-2004 Duncan Coutts 2007 |
---|---|
License | BSD3 |
Maintainer | cabal-devel@haskell.org |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
This is a big module, but not very complicated. The code is very regular
and repetitive. It defines the command line interface for all the Cabal
commands. For each command (like configure
, build
etc) it defines a type
that holds all the flags, the default set of flags and a CommandUI
that
maps command line flags to and from the corresponding flags type.
All the flags types are instances of Monoid
, see
http://www.haskell.org/pipermail/cabal-devel/2007-December/001509.html
for an explanation.
The types defined here get used in the front end and especially in
cabal-install
which has to do quite a bit of manipulating sets of command
line flags.
This is actually relatively nice, it works quite well. The main change it needs is to unify it with the code for managing sets of fields that can be read and written from files. This would allow us to save configure flags in config files.
Synopsis
- data GlobalFlags = GlobalFlags {}
- emptyGlobalFlags :: GlobalFlags
- defaultGlobalFlags :: GlobalFlags
- globalCommand :: [Command action] -> CommandUI GlobalFlags
- data ConfigFlags = ConfigFlags {
- configArgs :: [String]
- configPrograms_ :: Last' ProgramDb
- configProgramPaths :: [(String, FilePath)]
- configProgramArgs :: [(String, [String])]
- configProgramPathExtra :: NubList FilePath
- configHcFlavor :: Flag CompilerFlavor
- configHcPath :: Flag FilePath
- configHcPkg :: Flag FilePath
- configVanillaLib :: Flag Bool
- configProfLib :: Flag Bool
- configSharedLib :: Flag Bool
- configDynExe :: Flag Bool
- configProfExe :: Flag Bool
- configProf :: Flag Bool
- configProfDetail :: Flag ProfDetailLevel
- configProfLibDetail :: Flag ProfDetailLevel
- configConfigureArgs :: [String]
- configOptimization :: Flag OptimisationLevel
- configProgPrefix :: Flag PathTemplate
- configProgSuffix :: Flag PathTemplate
- configInstallDirs :: InstallDirs (Flag PathTemplate)
- configScratchDir :: Flag FilePath
- configExtraLibDirs :: [FilePath]
- configExtraFrameworkDirs :: [FilePath]
- configExtraIncludeDirs :: [FilePath]
- configIPID :: Flag String
- configCID :: Flag ComponentId
- configDeterministic :: Flag Bool
- configDistPref :: Flag FilePath
- configCabalFilePath :: Flag FilePath
- configVerbosity :: Flag Verbosity
- configUserInstall :: Flag Bool
- configPackageDBs :: [Maybe PackageDB]
- configGHCiLib :: Flag Bool
- configSplitObjs :: Flag Bool
- configStripExes :: Flag Bool
- configStripLibs :: Flag Bool
- configConstraints :: [Dependency]
- configDependencies :: [(PackageName, ComponentId)]
- configInstantiateWith :: [(ModuleName, Module)]
- configConfigurationsFlags :: FlagAssignment
- configTests :: Flag Bool
- configBenchmarks :: Flag Bool
- configCoverage :: Flag Bool
- configLibCoverage :: Flag Bool
- configExactConfiguration :: Flag Bool
- configFlagError :: Flag String
- configRelocatable :: Flag Bool
- configDebugInfo :: Flag DebugInfoLevel
- configAllowOlder :: Maybe AllowOlder
- configAllowNewer :: Maybe AllowNewer
- emptyConfigFlags :: ConfigFlags
- defaultConfigFlags :: ProgramDb -> ConfigFlags
- configureCommand :: ProgramDb -> CommandUI ConfigFlags
- configPrograms :: WithCallStack (ConfigFlags -> ProgramDb)
- data RelaxDeps
- data RelaxedDep
- isRelaxDeps :: RelaxDeps -> Bool
- newtype AllowNewer = AllowNewer {}
- newtype AllowOlder = AllowOlder {}
- configAbsolutePaths :: ConfigFlags -> NoCallStackIO ConfigFlags
- readPackageDbList :: String -> [Maybe PackageDB]
- showPackageDbList :: [Maybe PackageDB] -> [String]
- data CopyFlags = CopyFlags {}
- emptyCopyFlags :: CopyFlags
- defaultCopyFlags :: CopyFlags
- copyCommand :: CommandUI CopyFlags
- data InstallFlags = InstallFlags {}
- emptyInstallFlags :: InstallFlags
- defaultInstallFlags :: InstallFlags
- installCommand :: CommandUI InstallFlags
- data DoctestFlags = DoctestFlags {
- doctestProgramPaths :: [(String, FilePath)]
- doctestProgramArgs :: [(String, [String])]
- doctestDistPref :: Flag FilePath
- doctestVerbosity :: Flag Verbosity
- emptyDoctestFlags :: DoctestFlags
- defaultDoctestFlags :: DoctestFlags
- doctestCommand :: CommandUI DoctestFlags
- data HaddockTarget
- data HaddockFlags = HaddockFlags {
- haddockProgramPaths :: [(String, FilePath)]
- haddockProgramArgs :: [(String, [String])]
- haddockHoogle :: Flag Bool
- haddockHtml :: Flag Bool
- haddockHtmlLocation :: Flag String
- haddockForHackage :: Flag HaddockTarget
- haddockExecutables :: Flag Bool
- haddockTestSuites :: Flag Bool
- haddockBenchmarks :: Flag Bool
- haddockForeignLibs :: Flag Bool
- haddockInternal :: Flag Bool
- haddockCss :: Flag FilePath
- haddockHscolour :: Flag Bool
- haddockHscolourCss :: Flag FilePath
- haddockContents :: Flag PathTemplate
- haddockDistPref :: Flag FilePath
- haddockKeepTempFiles :: Flag Bool
- haddockVerbosity :: Flag Verbosity
- emptyHaddockFlags :: HaddockFlags
- defaultHaddockFlags :: HaddockFlags
- haddockCommand :: CommandUI HaddockFlags
- data HscolourFlags = HscolourFlags {}
- emptyHscolourFlags :: HscolourFlags
- defaultHscolourFlags :: HscolourFlags
- hscolourCommand :: CommandUI HscolourFlags
- data BuildFlags = BuildFlags {
- buildProgramPaths :: [(String, FilePath)]
- buildProgramArgs :: [(String, [String])]
- buildDistPref :: Flag FilePath
- buildVerbosity :: Flag Verbosity
- buildNumJobs :: Flag (Maybe Int)
- buildArgs :: [String]
- emptyBuildFlags :: BuildFlags
- defaultBuildFlags :: BuildFlags
- buildCommand :: ProgramDb -> CommandUI BuildFlags
- buildVerbose :: BuildFlags -> Verbosity
- data ReplFlags = ReplFlags {
- replProgramPaths :: [(String, FilePath)]
- replProgramArgs :: [(String, [String])]
- replDistPref :: Flag FilePath
- replVerbosity :: Flag Verbosity
- replReload :: Flag Bool
- defaultReplFlags :: ReplFlags
- replCommand :: ProgramDb -> CommandUI ReplFlags
- data CleanFlags = CleanFlags {}
- emptyCleanFlags :: CleanFlags
- defaultCleanFlags :: CleanFlags
- cleanCommand :: CommandUI CleanFlags
- data RegisterFlags = RegisterFlags {
- regPackageDB :: Flag PackageDB
- regGenScript :: Flag Bool
- regGenPkgConf :: Flag (Maybe FilePath)
- regInPlace :: Flag Bool
- regDistPref :: Flag FilePath
- regPrintId :: Flag Bool
- regVerbosity :: Flag Verbosity
- regArgs :: [String]
- emptyRegisterFlags :: RegisterFlags
- defaultRegisterFlags :: RegisterFlags
- registerCommand :: CommandUI RegisterFlags
- unregisterCommand :: CommandUI RegisterFlags
- data SDistFlags = SDistFlags {}
- emptySDistFlags :: SDistFlags
- defaultSDistFlags :: SDistFlags
- sdistCommand :: CommandUI SDistFlags
- data TestFlags = TestFlags {}
- emptyTestFlags :: TestFlags
- defaultTestFlags :: TestFlags
- testCommand :: CommandUI TestFlags
- data TestShowDetails
- data BenchmarkFlags = BenchmarkFlags {}
- emptyBenchmarkFlags :: BenchmarkFlags
- defaultBenchmarkFlags :: BenchmarkFlags
- benchmarkCommand :: CommandUI BenchmarkFlags
- data CopyDest
- configureArgs :: Bool -> ConfigFlags -> [String]
- configureOptions :: ShowOrParseArgs -> [OptionField ConfigFlags]
- configureCCompiler :: Verbosity -> ProgramDb -> IO (FilePath, [String])
- configureLinker :: Verbosity -> ProgramDb -> IO (FilePath, [String])
- buildOptions :: ProgramDb -> ShowOrParseArgs -> [OptionField BuildFlags]
- haddockOptions :: ShowOrParseArgs -> [OptionField HaddockFlags]
- installDirsOptions :: [OptionField (InstallDirs (Flag PathTemplate))]
- programDbOptions :: ProgramDb -> ShowOrParseArgs -> (flags -> [(String, [String])]) -> ([(String, [String])] -> flags -> flags) -> [OptionField flags]
- programDbPaths' :: (String -> String) -> ProgramDb -> ShowOrParseArgs -> (flags -> [(String, FilePath)]) -> ([(String, FilePath)] -> flags -> flags) -> [OptionField flags]
- programConfigurationOptions :: ProgramDb -> ShowOrParseArgs -> (flags -> [(String, [String])]) -> ([(String, [String])] -> flags -> flags) -> [OptionField flags]
- programConfigurationPaths' :: (String -> String) -> ProgramDb -> ShowOrParseArgs -> (flags -> [(String, FilePath)]) -> ([(String, FilePath)] -> flags -> flags) -> [OptionField flags]
- splitArgs :: String -> [String]
- defaultDistPref :: FilePath
- optionDistPref :: (flags -> Flag FilePath) -> (Flag FilePath -> flags -> flags) -> ShowOrParseArgs -> OptionField flags
- data Flag a
- toFlag :: a -> Flag a
- fromFlag :: WithCallStack (Flag a -> a)
- fromFlagOrDefault :: a -> Flag a -> a
- flagToMaybe :: Flag a -> Maybe a
- flagToList :: Flag a -> [a]
- maybeToFlag :: Maybe a -> Flag a
- class BooleanFlag a where
- boolOpt :: SFlags -> SFlags -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
- boolOpt' :: OptFlags -> OptFlags -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
- trueArg :: MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
- falseArg :: MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
- optionVerbosity :: (flags -> Flag Verbosity) -> (Flag Verbosity -> flags -> flags) -> OptionField flags
- optionNumJobs :: (flags -> Flag (Maybe Int)) -> (Flag (Maybe Int) -> flags -> flags) -> OptionField flags
- readPToMaybe :: ReadP a a -> String -> Maybe a
Documentation
data GlobalFlags Source #
Flags that apply at the top level, not to any sub-command.
Instances
Generic GlobalFlags Source # | |
type Rep GlobalFlags :: * -> * # from :: GlobalFlags -> Rep GlobalFlags x # to :: Rep GlobalFlags x -> GlobalFlags # | |
Semigroup GlobalFlags Source # | |
(<>) :: GlobalFlags -> GlobalFlags -> GlobalFlags # sconcat :: NonEmpty GlobalFlags -> GlobalFlags # stimes :: Integral b => b -> GlobalFlags -> GlobalFlags # | |
Monoid GlobalFlags Source # | |
mempty :: GlobalFlags # mappend :: GlobalFlags -> GlobalFlags -> GlobalFlags # mconcat :: [GlobalFlags] -> GlobalFlags # | |
type Rep GlobalFlags Source # | |
type Rep GlobalFlags = D1 * (MetaData "GlobalFlags" "Distribution.Simple.Setup" "Cabal-2.0.0.2-ArD10404PgFe4UBxSAxnL" False) (C1 * (MetaCons "GlobalFlags" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "globalVersion") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Flag Bool))) (S1 * (MetaSel (Just Symbol "globalNumericVersion") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Flag Bool))))) |
globalCommand :: [Command action] -> CommandUI GlobalFlags Source #
data ConfigFlags Source #
Flags to configure
command.
IMPORTANT: every time a new flag is added, filterConfigureFlags
should be updated.
IMPORTANT: every time a new flag is added, it should be added to the Eq instance
ConfigFlags | |
|
Instances
configPrograms :: WithCallStack (ConfigFlags -> ProgramDb) Source #
More convenient version of configPrograms
. Results in an
error
if internal invariant is violated.
Generic data type for policy when relaxing bounds in dependencies.
Don't use this directly: use AllowOlder
or AllowNewer
depending
on whether or not you are relaxing an lower or upper bound
(respectively).
RelaxDepsNone | Default: honor the upper bounds in all dependencies, never choose versions newer than allowed. |
RelaxDepsSome [RelaxedDep] | Ignore upper bounds in dependencies on the given packages. |
RelaxDepsAll | Ignore upper bounds in dependencies on all packages. |
Instances
Eq RelaxDeps Source # | |
Read RelaxDeps Source # | |
Show RelaxDeps Source # | |
Generic RelaxDeps Source # | |
Semigroup RelaxDeps Source # | |
Monoid RelaxDeps Source # | |
Binary RelaxDeps Source # | |
type Rep RelaxDeps Source # | |
type Rep RelaxDeps = D1 * (MetaData "RelaxDeps" "Distribution.Simple.Setup" "Cabal-2.0.0.2-ArD10404PgFe4UBxSAxnL" False) ((:+:) * (C1 * (MetaCons "RelaxDepsNone" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "RelaxDepsSome" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [RelaxedDep]))) (C1 * (MetaCons "RelaxDepsAll" PrefixI False) (U1 *)))) |
data RelaxedDep Source #
Dependencies can be relaxed either for all packages in the install plan, or only for some packages.
Instances
newtype AllowNewer Source #
RelaxDeps
in the context of upper bounds (i.e. for --allow-newer
flag)
Instances
Eq AllowNewer Source # | |
(==) :: AllowNewer -> AllowNewer -> Bool # (/=) :: AllowNewer -> AllowNewer -> Bool # | |
Read AllowNewer Source # | |
readsPrec :: Int -> ReadS AllowNewer # readList :: ReadS [AllowNewer] # readPrec :: ReadPrec AllowNewer # readListPrec :: ReadPrec [AllowNewer] # | |
Show AllowNewer Source # | |
showsPrec :: Int -> AllowNewer -> ShowS # show :: AllowNewer -> String # showList :: [AllowNewer] -> ShowS # | |
Generic AllowNewer Source # | |
type Rep AllowNewer :: * -> * # from :: AllowNewer -> Rep AllowNewer x # to :: Rep AllowNewer x -> AllowNewer # | |
Semigroup AllowNewer Source # | |
(<>) :: AllowNewer -> AllowNewer -> AllowNewer # sconcat :: NonEmpty AllowNewer -> AllowNewer # stimes :: Integral b => b -> AllowNewer -> AllowNewer # | |
Monoid AllowNewer Source # | |
mempty :: AllowNewer # mappend :: AllowNewer -> AllowNewer -> AllowNewer # mconcat :: [AllowNewer] -> AllowNewer # | |
Binary AllowNewer Source # | |
type Rep AllowNewer Source # | |
newtype AllowOlder Source #
RelaxDeps
in the context of lower bounds (i.e. for --allow-older
flag)
Instances
Eq AllowOlder Source # | |
(==) :: AllowOlder -> AllowOlder -> Bool # (/=) :: AllowOlder -> AllowOlder -> Bool # | |
Read AllowOlder Source # | |
readsPrec :: Int -> ReadS AllowOlder # readList :: ReadS [AllowOlder] # readPrec :: ReadPrec AllowOlder # readListPrec :: ReadPrec [AllowOlder] # | |
Show AllowOlder Source # | |
showsPrec :: Int -> AllowOlder -> ShowS # show :: AllowOlder -> String # showList :: [AllowOlder] -> ShowS # | |
Generic AllowOlder Source # | |
type Rep AllowOlder :: * -> * # from :: AllowOlder -> Rep AllowOlder x # to :: Rep AllowOlder x -> AllowOlder # | |
Semigroup AllowOlder Source # | |
(<>) :: AllowOlder -> AllowOlder -> AllowOlder # sconcat :: NonEmpty AllowOlder -> AllowOlder # stimes :: Integral b => b -> AllowOlder -> AllowOlder # | |
Monoid AllowOlder Source # | |
mempty :: AllowOlder # mappend :: AllowOlder -> AllowOlder -> AllowOlder # mconcat :: [AllowOlder] -> AllowOlder # | |
Binary AllowOlder Source # | |
type Rep AllowOlder Source # | |
Flags to copy
: (destdir, copy-prefix (backwards compat), verbosity)
Instances
Show CopyFlags Source # | |
Generic CopyFlags Source # | |
Semigroup CopyFlags Source # | |
Monoid CopyFlags Source # | |
type Rep CopyFlags Source # | |
type Rep CopyFlags = D1 * (MetaData "CopyFlags" "Distribution.Simple.Setup" "Cabal-2.0.0.2-ArD10404PgFe4UBxSAxnL" False) (C1 * (MetaCons "CopyFlags" PrefixI True) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "copyDest") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Flag CopyDest))) (S1 * (MetaSel (Just Symbol "copyDistPref") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Flag FilePath)))) ((:*:) * (S1 * (MetaSel (Just Symbol "copyVerbosity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Flag Verbosity))) (S1 * (MetaSel (Just Symbol "copyArgs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [String]))))) |
data InstallFlags Source #
Flags to install
: (package db, verbosity)
Instances
data DoctestFlags Source #
DoctestFlags | |
|
Instances
data HaddockTarget Source #
When we build haddock documentation, there are two cases:
- We build haddocks only for the current development version,
intended for local use and not for distribution. In this case,
we store the generated documentation in
distdochtml/name
. - We build haddocks for intended for uploading them to hackage.
In this case, we need to follow the layout that hackage expects
from documentation tarballs, and we might also want to use different
flags than for development builds, so in this case we store the generated
documentation in
distdochtml/id-docs
.
Instances
Eq HaddockTarget Source # | |
(==) :: HaddockTarget -> HaddockTarget -> Bool # (/=) :: HaddockTarget -> HaddockTarget -> Bool # | |
Show HaddockTarget Source # | |
showsPrec :: Int -> HaddockTarget -> ShowS # show :: HaddockTarget -> String # showList :: [HaddockTarget] -> ShowS # | |
Generic HaddockTarget Source # | |
type Rep HaddockTarget :: * -> * # from :: HaddockTarget -> Rep HaddockTarget x # to :: Rep HaddockTarget x -> HaddockTarget # | |
type Rep HaddockTarget Source # | |
data HaddockFlags Source #
Instances
data HscolourFlags Source #
Instances
data BuildFlags Source #
BuildFlags | |
|
Instances
buildVerbose :: BuildFlags -> Verbosity Source #
Deprecated: Use buildVerbosity instead
ReplFlags | |
|
Instances
Show ReplFlags Source # | |
Generic ReplFlags Source # | |
Semigroup ReplFlags Source # | |
Monoid ReplFlags Source # | |
type Rep ReplFlags Source # | |
type Rep ReplFlags = D1 * (MetaData "ReplFlags" "Distribution.Simple.Setup" "Cabal-2.0.0.2-ArD10404PgFe4UBxSAxnL" False) (C1 * (MetaCons "ReplFlags" PrefixI True) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "replProgramPaths") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(String, FilePath)])) (S1 * (MetaSel (Just Symbol "replProgramArgs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(String, [String])]))) ((:*:) * (S1 * (MetaSel (Just Symbol "replDistPref") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Flag FilePath))) ((:*:) * (S1 * (MetaSel (Just Symbol "replVerbosity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Flag Verbosity))) (S1 * (MetaSel (Just Symbol "replReload") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Flag Bool))))))) |
data CleanFlags Source #
Instances
data RegisterFlags Source #
Flags to register
and unregister
: (user package, gen-script,
in-place, verbosity)
RegisterFlags | |
|
Instances
data SDistFlags Source #
Flags to sdist
: (snapshot, verbosity)
Instances
Instances
data TestShowDetails Source #
Instances
data BenchmarkFlags Source #
Instances
The location prefix for the copy command.
configureArgs :: Bool -> ConfigFlags -> [String] Source #
Arguments to pass to a configure
script, e.g. generated by
autoconf
.
buildOptions :: ProgramDb -> ShowOrParseArgs -> [OptionField BuildFlags] Source #
programDbOptions :: ProgramDb -> ShowOrParseArgs -> (flags -> [(String, [String])]) -> ([(String, [String])] -> flags -> flags) -> [OptionField flags] Source #
For each known program PROG
in progDb
, produce a PROG-options
OptionField
.
programDbPaths' :: (String -> String) -> ProgramDb -> ShowOrParseArgs -> (flags -> [(String, FilePath)]) -> ([(String, FilePath)] -> flags -> flags) -> [OptionField flags] Source #
Like programDbPaths
, but allows to customise the option name.
programConfigurationOptions :: ProgramDb -> ShowOrParseArgs -> (flags -> [(String, [String])]) -> ([(String, [String])] -> flags -> flags) -> [OptionField flags] Source #
Deprecated: Use programDbOptions instead
For each known program PROG
in progDb
, produce a PROG-options
OptionField
.
programConfigurationPaths' :: (String -> String) -> ProgramDb -> ShowOrParseArgs -> (flags -> [(String, FilePath)]) -> ([(String, FilePath)] -> flags -> flags) -> [OptionField flags] Source #
Deprecated: Use programDbPaths' instead
Like programDbPaths
, but allows to customise the option name.
splitArgs :: String -> [String] Source #
Helper function to split a string into a list of arguments. It's supposed to handle quoted things sensibly, eg:
splitArgs "--foo=\"C:/Program Files/Bar/" --baz" = ["--foo=C:/Program Files/Bar", "--baz"]
splitArgs "\"-DMSGSTR=\\\"foo bar\\\"\" --baz" = ["-DMSGSTR=\"foo bar\"","--baz"]
optionDistPref :: (flags -> Flag FilePath) -> (Flag FilePath -> flags -> flags) -> ShowOrParseArgs -> OptionField flags Source #
All flags are monoids, they come in two flavours:
- list flags eg
--ghc-option=foo --ghc-option=bar
gives us all the values ["foo", "bar"]
- singular value flags, eg:
--enable-foo --disable-foo
gives us Just False
So this Flag type is for the latter singular kind of flag.
Its monoid instance gives us the behaviour where it starts out as
NoFlag
and later flags override earlier ones.
Instances
Functor Flag Source # | |
Bounded a => Bounded (Flag a) Source # | |
Enum a => Enum (Flag a) Source # | |
Eq a => Eq (Flag a) Source # | |
Read a => Read (Flag a) Source # | |
Show a => Show (Flag a) Source # | |
Generic (Flag a) Source # | |
Semigroup (Flag a) Source # | |
Monoid (Flag a) Source # | |
Binary a => Binary (Flag a) Source # | |
type Rep (Flag a) Source # | |
type Rep (Flag a) = D1 * (MetaData "Flag" "Distribution.Simple.Setup" "Cabal-2.0.0.2-ArD10404PgFe4UBxSAxnL" False) ((:+:) * (C1 * (MetaCons "Flag" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * a))) (C1 * (MetaCons "NoFlag" PrefixI False) (U1 *))) |
fromFlag :: WithCallStack (Flag a -> a) Source #
fromFlagOrDefault :: a -> Flag a -> a Source #
flagToMaybe :: Flag a -> Maybe a Source #
flagToList :: Flag a -> [a] Source #
maybeToFlag :: Maybe a -> Flag a Source #
class BooleanFlag a where Source #
Types that represent boolean flags.
optionVerbosity :: (flags -> Flag Verbosity) -> (Flag Verbosity -> flags -> flags) -> OptionField flags Source #
optionNumJobs :: (flags -> Flag (Maybe Int)) -> (Flag (Maybe Int) -> flags -> flags) -> OptionField flags Source #