Distribution.PackageDescription

Cabal-2.4.0.1: A framework for packaging Haskell software

Copyright | Isaac Jones 2003-2005
License | BSD3
Maintainer | cabal-devel@haskell.org
Portability | portable
Safe Haskell | None
Language | Haskell2010

Distribution.PackageDescription

Contents

- Package descriptions
  - Renaming (syntactic)
  - Libraries
  - Executables
- Tests
- Benchmarks
- Build information
  - Supplementary build information
- package configuration
- Source repositories
- Custom setup build information

Description

Backwards compatibility reexport of everything you need to know about `.cabal` files.

Synopsis

- data PackageDescription = PackageDescription {
  - specVersionRaw :: Either Version VersionRange
  - package :: PackageIdentifier
  - licenseRaw :: Either License License
  - licenseFiles :: [FilePath]
  - copyright :: String
  - maintainer :: String
  - author :: String
  - stability :: String
  - testedWith :: [(CompilerFlavor, VersionRange)]
  - homepage :: String
  - pkgUrl :: String
  - bugReports :: String
  - sourceRepos :: [SourceRepo]
  - synopsis :: String
  - description :: String
  - category :: String
  - customFieldsPD :: [(String, String)]
  - buildTypeRaw :: Maybe BuildType
  - setupBuildInfo :: Maybe SetupBuildInfo
  - library :: Maybe Library
  - subLibraries :: [Library]
  - executables :: [Executable]
  - foreignLibs :: [ForeignLib]
  - testSuites :: [TestSuite]
  - benchmarks :: [Benchmark]
  - dataFiles :: [FilePath]
  - dataDir :: FilePath
  - extraSrcFiles :: [FilePath]
  - extraTmpFiles :: [FilePath]
  - extraDocFiles :: [FilePath]
  }
- emptyPackageDescription :: PackageDescription
- specVersion :: PackageDescription -> Version
- buildType :: PackageDescription -> BuildType
- license :: PackageDescription -> License
- descCabalVersion :: PackageDescription -> VersionRange
- data BuildType
  - = Simple
  - | Configure
  - | Make
  - | Custom
- knownBuildTypes :: [BuildType]
- allLibraries :: PackageDescription -> [Library]
- data ModuleRenaming
  - = ModuleRenaming [(ModuleName, ModuleName)]
  - | DefaultRenaming
  - | HidingRenaming [ModuleName]
- defaultRenaming :: ModuleRenaming
- data Library = Library {
  - libName :: Maybe UnqualComponentName
  - exposedModules :: [ModuleName]
  - reexportedModules :: [ModuleReexport]
  - signatures :: [ModuleName]
  - libExposed :: Bool
  - libBuildInfo :: BuildInfo
  }
- data ModuleReexport = ModuleReexport {
  - moduleReexportOriginalPackage :: Maybe PackageName
  - moduleReexportOriginalName :: ModuleName
  - moduleReexportName :: ModuleName
  }
- emptyLibrary :: Library
- withLib :: PackageDescription -> (Library -> IO ()) -> IO ()
- hasPublicLib :: PackageDescription -> Bool
- hasLibs :: PackageDescription -> Bool
- explicitLibModules :: Library -> [ModuleName]
- libModulesAutogen :: Library -> [ModuleName]
- libModules :: Library -> [ModuleName]
- data Executable = Executable {
  - exeName :: UnqualComponentName
  - modulePath :: FilePath
  - exeScope :: ExecutableScope
  - buildInfo :: BuildInfo
  }
- emptyExecutable :: Executable
- withExe :: PackageDescription -> (Executable -> IO ()) -> IO ()
- hasExes :: PackageDescription -> Bool
- exeModules :: Executable -> [ModuleName]
- exeModulesAutogen :: Executable -> [ModuleName]
- data TestSuite = TestSuite {
  - testName :: UnqualComponentName
  - testInterface :: TestSuiteInterface
  - testBuildInfo :: BuildInfo
  }
- data TestSuiteInterface
  - = TestSuiteExeV10 Version FilePath
  - | TestSuiteLibV09 Version ModuleName
  - | TestSuiteUnsupported TestType
- data TestType
  - = TestTypeExe Version
  - | TestTypeLib Version
  - | TestTypeUnknown String Version
- testType :: TestSuite -> TestType
- knownTestTypes :: [TestType]
- emptyTestSuite :: TestSuite
- hasTests :: PackageDescription -> Bool
- withTest :: PackageDescription -> (TestSuite -> IO ()) -> IO ()
- testModules :: TestSuite -> [ModuleName]
- testModulesAutogen :: TestSuite -> [ModuleName]
- data Benchmark = Benchmark {
  - benchmarkName :: UnqualComponentName
  - benchmarkInterface :: BenchmarkInterface
  - benchmarkBuildInfo :: BuildInfo
  }
- data BenchmarkInterface
  - = BenchmarkExeV10 Version FilePath
  - | BenchmarkUnsupported BenchmarkType
- data BenchmarkType
  - = BenchmarkTypeExe Version
  - | BenchmarkTypeUnknown String Version
- benchmarkType :: Benchmark -> BenchmarkType
- knownBenchmarkTypes :: [BenchmarkType]
- emptyBenchmark :: Benchmark
- hasBenchmarks :: PackageDescription -> Bool
- withBenchmark :: PackageDescription -> (Benchmark -> IO ()) -> IO ()
- benchmarkModules :: Benchmark -> [ModuleName]
- benchmarkModulesAutogen :: Benchmark -> [ModuleName]
- data BuildInfo = BuildInfo {
  - buildable :: Bool
  - buildTools :: [LegacyExeDependency]
  - buildToolDepends :: [ExeDependency]
  - cppOptions :: [String]
  - asmOptions :: [String]
  - cmmOptions :: [String]
  - ccOptions :: [String]
  - cxxOptions :: [String]
  - ldOptions :: [String]
  - pkgconfigDepends :: [PkgconfigDependency]
  - frameworks :: [String]
  - extraFrameworkDirs :: [String]
  - asmSources :: [FilePath]
  - cmmSources :: [FilePath]
  - cSources :: [FilePath]
  - cxxSources :: [FilePath]
  - jsSources :: [FilePath]
  - hsSourceDirs :: [FilePath]
  - otherModules :: [ModuleName]
  - virtualModules :: [ModuleName]
  - autogenModules :: [ModuleName]
  - defaultLanguage :: Maybe Language
  - otherLanguages :: [Language]
  - defaultExtensions :: [Extension]
  - otherExtensions :: [Extension]
  - oldExtensions :: [Extension]
  - extraLibs :: [String]
  - extraGHCiLibs :: [String]
  - extraBundledLibs :: [String]
  - extraLibFlavours :: [String]
  - extraLibDirs :: [String]
  - includeDirs :: [FilePath]
  - includes :: [FilePath]
  - installIncludes :: [FilePath]
  - options :: [(CompilerFlavor, [String])]
  - profOptions :: [(CompilerFlavor, [String])]
  - sharedOptions :: [(CompilerFlavor, [String])]
  - staticOptions :: [(CompilerFlavor, [String])]
  - customFieldsBI :: [(String, String)]
  - targetBuildDepends :: [Dependency]
  - mixins :: [Mixin]
  }
- emptyBuildInfo :: BuildInfo
- allBuildInfo :: PackageDescription -> [BuildInfo]
- allLanguages :: BuildInfo -> [Language]
- allExtensions :: BuildInfo -> [Extension]
- usedExtensions :: BuildInfo -> [Extension]
- usesTemplateHaskellOrQQ :: BuildInfo -> Bool
- hcOptions :: CompilerFlavor -> BuildInfo -> [String]
- hcProfOptions :: CompilerFlavor -> BuildInfo -> [String]
- hcSharedOptions :: CompilerFlavor -> BuildInfo -> [String]
- hcStaticOptions :: CompilerFlavor -> BuildInfo -> [String]
- allBuildDepends :: PackageDescription -> [Dependency]
- enabledBuildDepends :: PackageDescription -> ComponentRequestedSpec -> [Dependency]
- data ComponentName
  - = CLibName
  - | CSubLibName UnqualComponentName
  - | CFLibName UnqualComponentName
  - | CExeName UnqualComponentName
  - | CTestName UnqualComponentName
  - | CBenchName UnqualComponentName
- defaultLibName :: ComponentName
- type HookedBuildInfo = (Maybe BuildInfo, [(UnqualComponentName, BuildInfo)])
- emptyHookedBuildInfo :: HookedBuildInfo
- updatePackageDescription :: HookedBuildInfo -> PackageDescription -> PackageDescription
- data GenericPackageDescription = GenericPackageDescription {
  - packageDescription :: PackageDescription
  - genPackageFlags :: [Flag]
  - condLibrary :: Maybe (CondTree ConfVar [Dependency] Library)
  - condSubLibraries :: [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
  - condForeignLibs :: [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)]
  - condExecutables :: [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)]
  - condTestSuites :: [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
  - condBenchmarks :: [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
  }
- data Flag = MkFlag {
  - flagName :: FlagName
  - flagDescription :: String
  - flagDefault :: Bool
  - flagManual :: Bool
  }
- emptyFlag :: FlagName -> Flag
- data FlagName
- mkFlagName :: String -> FlagName
- unFlagName :: FlagName -> String
- data FlagAssignment
- mkFlagAssignment :: [(FlagName, Bool)] -> FlagAssignment
- unFlagAssignment :: FlagAssignment -> [(FlagName, Bool)]
- nullFlagAssignment :: FlagAssignment -> Bool
- showFlagValue :: (FlagName, Bool) -> String
- diffFlagAssignment :: FlagAssignment -> FlagAssignment -> FlagAssignment
- lookupFlagAssignment :: FlagName -> FlagAssignment -> Maybe Bool
- insertFlagAssignment :: FlagName -> Bool -> FlagAssignment -> FlagAssignment
- dispFlagAssignment :: FlagAssignment -> Doc
- parseFlagAssignment :: ReadP r FlagAssignment
- parsecFlagAssignment :: ParsecParser FlagAssignment
- findDuplicateFlagAssignments :: FlagAssignment -> [FlagName]
- data CondTree v c a = CondNode {
  - condTreeData :: a
  - condTreeConstraints :: c
  - condTreeComponents :: [CondBranch v c a]
  }
- data ConfVar
  - = OS OS
  - | Arch Arch
  - | Flag FlagName
  - | Impl CompilerFlavor VersionRange
- data Condition c
  - = Var c
  - | Lit Bool
  - | CNot (Condition c)
  - | COr (Condition c) (Condition c)
  - | CAnd (Condition c) (Condition c)
- cNot :: Condition a -> Condition a
- cAnd :: Condition a -> Condition a -> Condition a
- cOr :: Eq v => Condition v -> Condition v -> Condition v
- data SourceRepo = SourceRepo {
  - repoKind :: RepoKind
  - repoType :: Maybe RepoType
  - repoLocation :: Maybe String
  - repoModule :: Maybe String
  - repoBranch :: Maybe String
  - repoTag :: Maybe String
  - repoSubdir :: Maybe FilePath
  }
- data RepoKind
  - = RepoHead
  - | RepoThis
  - | RepoKindUnknown String
- data RepoType
  - = Darcs
  - | Git
  - | SVN
  - | CVS
  - | Mercurial
  - | GnuArch
  - | Bazaar
  - | Monotone
  - | OtherRepoType String
- knownRepoTypes :: [RepoType]
- emptySourceRepo :: RepoKind -> SourceRepo
- data SetupBuildInfo = SetupBuildInfo {
  - setupDepends :: [Dependency]
  - defaultSetupDepends :: Bool
  }

# Package descriptions

data PackageDescription #

This data type is the internal representation of the file `pkg.cabal`. It contains two kinds of information about the package: information which is needed for all packages, such as the package name and version, and information which is needed for the simple build system only, such as the compiler options and library name.

Constructors

PackageDescription |
Fields specVersionRaw :: Either Version VersionRange The version of the Cabal spec that this package description uses. For historical reasons this is specified with a version range but only ranges of the form `>= v` make sense. We are in the process of transitioning to specifying just a single version, not a range. See also `specVersion`. package :: PackageIdentifier licenseRaw :: Either License License licenseFiles :: [FilePath] copyright :: String maintainer :: String author :: String stability :: String testedWith :: [(CompilerFlavor, VersionRange)] homepage :: String pkgUrl :: String bugReports :: String sourceRepos :: [SourceRepo] synopsis :: String A one-line summary of this package description :: String A more verbose description of this package category :: String customFieldsPD :: [(String, String)] Custom fields starting with x-, stored in a simple assoc-list. buildTypeRaw :: Maybe BuildType The original `build-type` value as parsed from the `.cabal` file without defaulting. See also `buildType`. Since: Cabal-2.2 setupBuildInfo :: Maybe SetupBuildInfo library :: Maybe Library subLibraries :: [Library] executables :: [Executable] foreignLibs :: [ForeignLib] testSuites :: [TestSuite] benchmarks :: [Benchmark] dataFiles :: [FilePath] dataDir :: FilePath extraSrcFiles :: [FilePath] extraTmpFiles :: [FilePath] extraDocFiles :: [FilePath]

Instances

Eq PackageDescription # |
Instance details Defined in Distribution.Types.PackageDescription Methods (==) :: PackageDescription -> PackageDescription -> Bool # (/=) :: PackageDescription -> PackageDescription -> Bool #
Data PackageDescription # |
Instance details Defined in Distribution.Types.PackageDescription Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PackageDescription -> c PackageDescription Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PackageDescription Source # toConstr :: PackageDescription -> Constr Source # dataTypeOf :: PackageDescription -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PackageDescription) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PackageDescription) Source # gmapT :: (forall b. Data b => b -> b) -> PackageDescription -> PackageDescription Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PackageDescription -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PackageDescription -> r Source # gmapQ :: (forall d. Data d => d -> u) -> PackageDescription -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> PackageDescription -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PackageDescription -> m PackageDescription Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PackageDescription -> m PackageDescription Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PackageDescription -> m PackageDescription Source #
Read PackageDescription # |
Instance details Defined in Distribution.Types.PackageDescription Methods readsPrec :: Int -> ReadS PackageDescription Source # readList :: ReadS [PackageDescription] Source # readPrec :: ReadPrec PackageDescription Source # readListPrec :: ReadPrec [PackageDescription] Source #
Show PackageDescription # |
Instance details Defined in Distribution.Types.PackageDescription Methods showsPrec :: Int -> PackageDescription -> ShowS Source # show :: PackageDescription -> String Source # showList :: [PackageDescription] -> ShowS Source #
Generic PackageDescription # |
Instance details Defined in Distribution.Types.PackageDescription Associated Types type Rep PackageDescription :: Type -> Type Source # Methods from :: PackageDescription -> Rep PackageDescription x Source # to :: Rep PackageDescription x -> PackageDescription Source #
Binary PackageDescription # |
Instance details Defined in Distribution.Types.PackageDescription Methods put :: PackageDescription -> Put Source # get :: Get PackageDescription Source # putList :: [PackageDescription] -> Put Source #
NFData PackageDescription # |
Instance details Defined in Distribution.Types.PackageDescription Methods rnf :: PackageDescription -> () Source #
Package PackageDescription # |
Instance details Defined in Distribution.Types.PackageDescription Methods packageId :: PackageDescription -> PackageIdentifier #
HasBuildInfos PackageDescription # |
Instance details Defined in Distribution.Types.PackageDescription Methods traverseBuildInfos :: Traversal' PackageDescription BuildInfo #
type Rep PackageDescription # |
Instance details Defined in Distribution.Types.PackageDescription type Rep PackageDescription = D1 (MetaData "PackageDescription" "Distribution.Types.PackageDescription" "Cabal-2.4.0.1" False) (C1 (MetaCons "PackageDescription" PrefixI True) ((((S1 (MetaSel (Just "specVersionRaw") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Either Version VersionRange)) :*: (S1 (MetaSel (Just "package") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 PackageIdentifier) :*: S1 (MetaSel (Just "licenseRaw") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Either License License)))) :*: ((S1 (MetaSel (Just "licenseFiles") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath]) :*: S1 (MetaSel (Just "copyright") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) :*: (S1 (MetaSel (Just "maintainer") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: S1 (MetaSel (Just "author") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)))) :*: (((S1 (MetaSel (Just "stability") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: S1 (MetaSel (Just "testedWith") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(CompilerFlavor, VersionRange)])) :*: (S1 (MetaSel (Just "homepage") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: S1 (MetaSel (Just "pkgUrl") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))) :*: ((S1 (MetaSel (Just "bugReports") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: S1 (MetaSel (Just "sourceRepos") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [SourceRepo])) :*: (S1 (MetaSel (Just "synopsis") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: S1 (MetaSel (Just "description") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))))) :*: (((S1 (MetaSel (Just "category") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: (S1 (MetaSel (Just "customFieldsPD") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(String, String)]) :*: S1 (MetaSel (Just "buildTypeRaw") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe BuildType)))) :*: ((S1 (MetaSel (Just "setupBuildInfo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe SetupBuildInfo)) :*: S1 (MetaSel (Just "library") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Library))) :*: (S1 (MetaSel (Just "subLibraries") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Library]) :*: S1 (MetaSel (Just "executables") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Executable])))) :*: (((S1 (MetaSel (Just "foreignLibs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ForeignLib]) :*: S1 (MetaSel (Just "testSuites") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [TestSuite])) :*: (S1 (MetaSel (Just "benchmarks") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Benchmark]) :*: S1 (MetaSel (Just "dataFiles") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath]))) :*: ((S1 (MetaSel (Just "dataDir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath) :*: S1 (MetaSel (Just "extraSrcFiles") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath])) :*: (S1 (MetaSel (Just "extraTmpFiles") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath]) :*: S1 (MetaSel (Just "extraDocFiles") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath])))))))

emptyPackageDescription :: PackageDescription #

specVersion :: PackageDescription -> Version #

The version of the Cabal spec that this package should be interpreted against.

Historically we used a version range but we are switching to using a single version. Currently we accept either. This function converts into a single version by ignoring upper bounds in the version range.

buildType :: PackageDescription -> BuildType #

The effective `build-type` after applying defaulting rules.

The original `build-type` value parsed is stored in the `buildTypeRaw` field. However, the `build-type` field is optional and can therefore be empty in which case we need to compute the effective `build-type`. This function implements the following defaulting rules:

- For `cabal-version:2.0` and below, default to the `Custom` build-type unconditionally.
- Otherwise, if a `custom-setup` stanza is defined, default to the `Custom` build-type; else default to `Simple` build-type.

Since: Cabal-2.2

license :: PackageDescription -> License #

The SPDX `LicenseExpression` of the package.

Since: Cabal-2.2.0.0

descCabalVersion :: PackageDescription -> VersionRange #

Deprecated: Use specVersion instead. This symbol will be removed in Cabal-3.0 (est. Oct 2018).

The range of versions of the Cabal tools that this package is intended to work with.

This function is deprecated and should not be used for new purposes, only to support old packages that rely on the old interpretation.

data BuildType #

The type of build system used by this package.

Constructors

Simple | calls `Distribution.Simple.defaultMain`
Configure | calls `Distribution.Simple.defaultMainWithHooks defaultUserHooks`, which invokes `configure` to generate additional build information used by later phases.
Make | calls `Distribution.Make.defaultMain`
Custom | uses user-supplied `Setup.hs` or `Setup.lhs` (default)

Instances

Eq BuildType # |
Instance details Defined in Distribution.Types.BuildType Methods (==) :: BuildType -> BuildType -> Bool # (/=) :: BuildType -> BuildType -> Bool #
Data BuildType # |
Instance details Defined in Distribution.Types.BuildType Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuildType -> c BuildType Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BuildType Source # toConstr :: BuildType -> Constr Source # dataTypeOf :: BuildType -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BuildType) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BuildType) Source # gmapT :: (forall b. Data b => b -> b) -> BuildType -> BuildType Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuildType -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuildType -> r Source # gmapQ :: (forall d. Data d => d -> u) -> BuildType -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> BuildType -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuildType -> m BuildType Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuildType -> m BuildType Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuildType -> m BuildType Source #
Read BuildType # |
Instance details Defined in Distribution.Types.BuildType Methods readsPrec :: Int -> ReadS BuildType Source # readList :: ReadS [BuildType] Source # readPrec :: ReadPrec BuildType Source # readListPrec :: ReadPrec [BuildType] Source #
Show BuildType # |
Instance details Defined in Distribution.Types.BuildType Methods showsPrec :: Int -> BuildType -> ShowS Source # show :: BuildType -> String Source # showList :: [BuildType] -> ShowS Source #
Generic BuildType # |
Instance details Defined in Distribution.Types.BuildType Associated Types type Rep BuildType :: Type -> Type Source # Methods from :: BuildType -> Rep BuildType x Source # to :: Rep BuildType x -> BuildType Source #
Binary BuildType # |
Instance details Defined in Distribution.Types.BuildType Methods put :: BuildType -> Put Source # get :: Get BuildType Source # putList :: [BuildType] -> Put Source #
NFData BuildType # |
Instance details Defined in Distribution.Types.BuildType Methods rnf :: BuildType -> () Source #
Pretty BuildType # |
Instance details Defined in Distribution.Types.BuildType Methods pretty :: BuildType -> Doc #
Parsec BuildType # |
Instance details Defined in Distribution.Types.BuildType Methods parsec :: CabalParsing m => m BuildType #
Text BuildType # |
Instance details Defined in Distribution.Types.BuildType Methods disp :: BuildType -> Doc # parse :: ReadP r BuildType #
type Rep BuildType # |
Instance details Defined in Distribution.Types.BuildType type Rep BuildType = D1 (MetaData "BuildType" "Distribution.Types.BuildType" "Cabal-2.4.0.1" False) ((C1 (MetaCons "Simple" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Configure" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "Make" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Custom" PrefixI False) (U1 :: Type -> Type)))

knownBuildTypes :: [BuildType] #

allLibraries :: PackageDescription -> [Library] #

## Renaming (syntactic)

data ModuleRenaming #

Renaming applied to the modules provided by a package. The boolean indicates whether or not to also include all of the original names of modules. Thus, `ModuleRenaming False []` is "don't expose any modules, and `ModuleRenaming True [(Data.Bool, Bool)]` is, "expose all modules, but also expose `Data.Bool` as `Bool`". If a renaming is omitted you get the `DefaultRenaming`.

(NB: This is a list not a map so that we can preserve order.)

Constructors

ModuleRenaming [(ModuleName, ModuleName)] | A module renaming/thinning; e.g., `(A as B, C as C)` brings `B` and `C` into scope.
DefaultRenaming | The default renaming, bringing all exported modules into scope.
HidingRenaming [ModuleName] | Hiding renaming, e.g., `hiding (A, B)`, bringing all exported modules into scope except the hidden ones.

Instances

Eq ModuleRenaming # |
Instance details Defined in Distribution.Types.ModuleRenaming Methods (==) :: ModuleRenaming -> ModuleRenaming -> Bool # (/=) :: ModuleRenaming -> ModuleRenaming -> Bool #
Data ModuleRenaming # |
Instance details Defined in Distribution.Types.ModuleRenaming Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ModuleRenaming -> c ModuleRenaming Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ModuleRenaming Source # toConstr :: ModuleRenaming -> Constr Source # dataTypeOf :: ModuleRenaming -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ModuleRenaming) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModuleRenaming) Source # gmapT :: (forall b. Data b => b -> b) -> ModuleRenaming -> ModuleRenaming Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ModuleRenaming -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ModuleRenaming -> r Source # gmapQ :: (forall d. Data d => d -> u) -> ModuleRenaming -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> ModuleRenaming -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ModuleRenaming -> m ModuleRenaming Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ModuleRenaming -> m ModuleRenaming Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ModuleRenaming -> m ModuleRenaming Source #
Ord ModuleRenaming # |
Instance details Defined in Distribution.Types.ModuleRenaming Methods compare :: ModuleRenaming -> ModuleRenaming -> Ordering # (<) :: ModuleRenaming -> ModuleRenaming -> Bool # (<=) :: ModuleRenaming -> ModuleRenaming -> Bool # (>) :: ModuleRenaming -> ModuleRenaming -> Bool # (>=) :: ModuleRenaming -> ModuleRenaming -> Bool # max :: ModuleRenaming -> ModuleRenaming -> ModuleRenaming # min :: ModuleRenaming -> ModuleRenaming -> ModuleRenaming #
Read ModuleRenaming # |
Instance details Defined in Distribution.Types.ModuleRenaming Methods readsPrec :: Int -> ReadS ModuleRenaming Source # readList :: ReadS [ModuleRenaming] Source # readPrec :: ReadPrec ModuleRenaming Source # readListPrec :: ReadPrec [ModuleRenaming] Source #
Show ModuleRenaming # |
Instance details Defined in Distribution.Types.ModuleRenaming Methods showsPrec :: Int -> ModuleRenaming -> ShowS Source # show :: ModuleRenaming -> String Source # showList :: [ModuleRenaming] -> ShowS Source #
Generic ModuleRenaming # |
Instance details Defined in Distribution.Types.ModuleRenaming Associated Types type Rep ModuleRenaming :: Type -> Type Source # Methods from :: ModuleRenaming -> Rep ModuleRenaming x Source # to :: Rep ModuleRenaming x -> ModuleRenaming Source #
Binary ModuleRenaming # |
Instance details Defined in Distribution.Types.ModuleRenaming Methods put :: ModuleRenaming -> Put Source # get :: Get ModuleRenaming Source # putList :: [ModuleRenaming] -> Put Source #
NFData ModuleRenaming # |
Instance details Defined in Distribution.Types.ModuleRenaming Methods rnf :: ModuleRenaming -> () Source #
Pretty ModuleRenaming # |
Instance details Defined in Distribution.Types.ModuleRenaming Methods pretty :: ModuleRenaming -> Doc #
Parsec ModuleRenaming # |
Instance details Defined in Distribution.Types.ModuleRenaming Methods parsec :: CabalParsing m => m ModuleRenaming #
Text ModuleRenaming # |
Instance details Defined in Distribution.Types.ModuleRenaming Methods disp :: ModuleRenaming -> Doc # parse :: ReadP r ModuleRenaming #
type Rep ModuleRenaming # |
Instance details Defined in Distribution.Types.ModuleRenaming type Rep ModuleRenaming = D1 (MetaData "ModuleRenaming" "Distribution.Types.ModuleRenaming" "Cabal-2.4.0.1" False) (C1 (MetaCons "ModuleRenaming" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(ModuleName, ModuleName)])) :+: (C1 (MetaCons "DefaultRenaming" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "HidingRenaming" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ModuleName]))))

defaultRenaming :: ModuleRenaming #

The default renaming, if something is specified in `build-depends` only.

## Libraries

data Library #

Constructors

Library |
Fields libName :: Maybe UnqualComponentName exposedModules :: [ModuleName] reexportedModules :: [ModuleReexport] signatures :: [ModuleName] What sigs need implementations? libExposed :: Bool Is the lib to be exposed by default? libBuildInfo :: BuildInfo

Instances

Eq Library # |
Instance details Defined in Distribution.Types.Library Methods (==) :: Library -> Library -> Bool # (/=) :: Library -> Library -> Bool #
Data Library # |
Instance details Defined in Distribution.Types.Library Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Library -> c Library Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Library Source # toConstr :: Library -> Constr Source # dataTypeOf :: Library -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Library) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Library) Source # gmapT :: (forall b. Data b => b -> b) -> Library -> Library Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Library -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Library -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Library -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Library -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Library -> m Library Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Library -> m Library Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Library -> m Library Source #
Read Library # |
Instance details Defined in Distribution.Types.Library Methods readsPrec :: Int -> ReadS Library Source # readList :: ReadS [Library] Source # readPrec :: ReadPrec Library Source # readListPrec :: ReadPrec [Library] Source #
Show Library # |
Instance details Defined in Distribution.Types.Library Methods showsPrec :: Int -> Library -> ShowS Source # show :: Library -> String Source # showList :: [Library] -> ShowS Source #
Generic Library # |
Instance details Defined in Distribution.Types.Library Associated Types type Rep Library :: Type -> Type Source # Methods from :: Library -> Rep Library x Source # to :: Rep Library x -> Library Source #
Semigroup Library # |
Instance details Defined in Distribution.Types.Library Methods (<>) :: Library -> Library -> Library Source # sconcat :: NonEmpty Library -> Library Source # stimes :: Integral b => b -> Library -> Library Source #
Monoid Library # |
Instance details Defined in Distribution.Types.Library Methods mempty :: Library Source # mappend :: Library -> Library -> Library Source # mconcat :: [Library] -> Library Source #
Binary Library # |
Instance details Defined in Distribution.Types.Library Methods put :: Library -> Put Source # get :: Get Library Source # putList :: [Library] -> Put Source #
NFData Library # |
Instance details Defined in Distribution.Types.Library Methods rnf :: Library -> () Source #
HasBuildInfo Library # |
Instance details Defined in Distribution.Types.Library Methods buildInfo :: Lens' Library BuildInfo # buildable :: Lens' Library Bool # buildTools :: Lens' Library [LegacyExeDependency] # buildToolDepends :: Lens' Library [ExeDependency] # cppOptions :: Lens' Library [String] # asmOptions :: Lens' Library [String] # cmmOptions :: Lens' Library [String] # ccOptions :: Lens' Library [String] # cxxOptions :: Lens' Library [String] # ldOptions :: Lens' Library [String] # pkgconfigDepends :: Lens' Library [PkgconfigDependency] # frameworks :: Lens' Library [String] # extraFrameworkDirs :: Lens' Library [String] # asmSources :: Lens' Library [FilePath] # cmmSources :: Lens' Library [FilePath] # cSources :: Lens' Library [FilePath] # cxxSources :: Lens' Library [FilePath] # jsSources :: Lens' Library [FilePath] # hsSourceDirs :: Lens' Library [FilePath] # otherModules :: Lens' Library [ModuleName] # virtualModules :: Lens' Library [ModuleName] # autogenModules :: Lens' Library [ModuleName] # defaultLanguage :: Lens' Library (Maybe Language) # otherLanguages :: Lens' Library [Language] # defaultExtensions :: Lens' Library [Extension] # otherExtensions :: Lens' Library [Extension] # oldExtensions :: Lens' Library [Extension] # extraLibs :: Lens' Library [String] # extraGHCiLibs :: Lens' Library [String] # extraBundledLibs :: Lens' Library [String] # extraLibFlavours :: Lens' Library [String] # extraLibDirs :: Lens' Library [String] # includeDirs :: Lens' Library [FilePath] # includes :: Lens' Library [FilePath] # installIncludes :: Lens' Library [FilePath] # options :: Lens' Library [(CompilerFlavor, [String])] # profOptions :: Lens' Library [(CompilerFlavor, [String])] # sharedOptions :: Lens' Library [(CompilerFlavor, [String])] # staticOptions :: Lens' Library [(CompilerFlavor, [String])] # customFieldsBI :: Lens' Library [(String, String)] # targetBuildDepends :: Lens' Library [Dependency] # mixins :: Lens' Library [Mixin] #
type Rep Library # |
Instance details Defined in Distribution.Types.Library type Rep Library = D1 (MetaData "Library" "Distribution.Types.Library" "Cabal-2.4.0.1" False) (C1 (MetaCons "Library" PrefixI True) ((S1 (MetaSel (Just "libName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe UnqualComponentName)) :*: (S1 (MetaSel (Just "exposedModules") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ModuleName]) :*: S1 (MetaSel (Just "reexportedModules") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ModuleReexport]))) :*: (S1 (MetaSel (Just "signatures") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ModuleName]) :*: (S1 (MetaSel (Just "libExposed") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "libBuildInfo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 BuildInfo)))))

data ModuleReexport #

Constructors

ModuleReexport |
Fields moduleReexportOriginalPackage :: Maybe PackageName moduleReexportOriginalName :: ModuleName moduleReexportName :: ModuleName

Instances

Eq ModuleReexport # |
Instance details Defined in Distribution.Types.ModuleReexport Methods (==) :: ModuleReexport -> ModuleReexport -> Bool # (/=) :: ModuleReexport -> ModuleReexport -> Bool #
Data ModuleReexport # |
Instance details Defined in Distribution.Types.ModuleReexport Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ModuleReexport -> c ModuleReexport Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ModuleReexport Source # toConstr :: ModuleReexport -> Constr Source # dataTypeOf :: ModuleReexport -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ModuleReexport) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModuleReexport) Source # gmapT :: (forall b. Data b => b -> b) -> ModuleReexport -> ModuleReexport Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ModuleReexport -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ModuleReexport -> r Source # gmapQ :: (forall d. Data d => d -> u) -> ModuleReexport -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> ModuleReexport -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ModuleReexport -> m ModuleReexport Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ModuleReexport -> m ModuleReexport Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ModuleReexport -> m ModuleReexport Source #
Read ModuleReexport # |
Instance details Defined in Distribution.Types.ModuleReexport Methods readsPrec :: Int -> ReadS ModuleReexport Source # readList :: ReadS [ModuleReexport] Source # readPrec :: ReadPrec ModuleReexport Source # readListPrec :: ReadPrec [ModuleReexport] Source #
Show ModuleReexport # |
Instance details Defined in Distribution.Types.ModuleReexport Methods showsPrec :: Int -> ModuleReexport -> ShowS Source # show :: ModuleReexport -> String Source # showList :: [ModuleReexport] -> ShowS Source #
Generic ModuleReexport # |
Instance details Defined in Distribution.Types.ModuleReexport Associated Types type Rep ModuleReexport :: Type -> Type Source # Methods from :: ModuleReexport -> Rep ModuleReexport x Source # to :: Rep ModuleReexport x -> ModuleReexport Source #
Binary ModuleReexport # |
Instance details Defined in Distribution.Types.ModuleReexport Methods put :: ModuleReexport -> Put Source # get :: Get ModuleReexport Source # putList :: [ModuleReexport] -> Put Source #
NFData ModuleReexport # |
Instance details Defined in Distribution.Types.ModuleReexport Methods rnf :: ModuleReexport -> () Source #
Pretty ModuleReexport # |
Instance details Defined in Distribution.Types.ModuleReexport Methods pretty :: ModuleReexport -> Doc #
Parsec ModuleReexport # |
Instance details Defined in Distribution.Types.ModuleReexport Methods parsec :: CabalParsing m => m ModuleReexport #
Text ModuleReexport # |
Instance details Defined in Distribution.Types.ModuleReexport Methods disp :: ModuleReexport -> Doc # parse :: ReadP r ModuleReexport #
type Rep ModuleReexport # |
Instance details Defined in Distribution.Types.ModuleReexport type Rep ModuleReexport = D1 (MetaData "ModuleReexport" "Distribution.Types.ModuleReexport" "Cabal-2.4.0.1" False) (C1 (MetaCons "ModuleReexport" PrefixI True) (S1 (MetaSel (Just "moduleReexportOriginalPackage") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe PackageName)) :*: (S1 (MetaSel (Just "moduleReexportOriginalName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ModuleName) :*: S1 (MetaSel (Just "moduleReexportName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ModuleName))))

emptyLibrary :: Library #

withLib :: PackageDescription -> (Library -> IO ()) -> IO () #

If the package description has a buildable library section, call the given function with the library build info as argument. You probably want `withLibLBI` if you have a `LocalBuildInfo`, see the note in Distribution.Types.ComponentRequestedSpec for more information.

hasPublicLib :: PackageDescription -> Bool #

Does this package have a buildable PUBLIC library?

hasLibs :: PackageDescription -> Bool #

Does this package have any libraries?

explicitLibModules :: Library -> [ModuleName] #

Get all the module names from the library (exposed and internal modules) which are explicitly listed in the package description which would need to be compiled. (This does not include reexports, which do not need to be compiled.) This may not include all modules for which GHC generated interface files (i.e., implicit modules.)

libModulesAutogen :: Library -> [ModuleName] #

Get all the auto generated module names from the library, exposed or not. This are a subset of `libModules`.

libModules :: Library -> [ModuleName] #

Deprecated: If you want all modules that are built with a library, use `allLibModules`. Otherwise, use `explicitLibModules` for ONLY the modules explicitly mentioned in the package description. This symbol will be removed in Cabal-3.0 (est. Oct 2018).

Backwards-compatibility shim for `explicitLibModules`. In most cases, you actually want `allLibModules`, which returns all modules that will actually be compiled, as opposed to those which are explicitly listed in the package description (`explicitLibModules`); unfortunately, the type signature for `allLibModules` is incompatible since we need a `ComponentLocalBuildInfo`.

## Executables

data Executable #

Constructors

Executable |
Fields exeName :: UnqualComponentName modulePath :: FilePath exeScope :: ExecutableScope buildInfo :: BuildInfo

Instances

Eq Executable # |
Instance details Defined in Distribution.Types.Executable Methods (==) :: Executable -> Executable -> Bool # (/=) :: Executable -> Executable -> Bool #
Data Executable # |
Instance details Defined in Distribution.Types.Executable Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Executable -> c Executable Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Executable Source # toConstr :: Executable -> Constr Source # dataTypeOf :: Executable -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Executable) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Executable) Source # gmapT :: (forall b. Data b => b -> b) -> Executable -> Executable Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Executable -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Executable -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Executable -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Executable -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Executable -> m Executable Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Executable -> m Executable Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Executable -> m Executable Source #
Read Executable # |
Instance details Defined in Distribution.Types.Executable Methods readsPrec :: Int -> ReadS Executable Source # readList :: ReadS [Executable] Source # readPrec :: ReadPrec Executable Source # readListPrec :: ReadPrec [Executable] Source #
Show Executable # |
Instance details Defined in Distribution.Types.Executable Methods showsPrec :: Int -> Executable -> ShowS Source # show :: Executable -> String Source # showList :: [Executable] -> ShowS Source #
Generic Executable # |
Instance details Defined in Distribution.Types.Executable Associated Types type Rep Executable :: Type -> Type Source # Methods from :: Executable -> Rep Executable x Source # to :: Rep Executable x -> Executable Source #
Semigroup Executable # |
Instance details Defined in Distribution.Types.Executable Methods (<>) :: Executable -> Executable -> Executable Source # sconcat :: NonEmpty Executable -> Executable Source # stimes :: Integral b => b -> Executable -> Executable Source #
Monoid Executable # |
Instance details Defined in Distribution.Types.Executable Methods mempty :: Executable Source # mappend :: Executable -> Executable -> Executable Source # mconcat :: [Executable] -> Executable Source #
Binary Executable # |
Instance details Defined in Distribution.Types.Executable Methods put :: Executable -> Put Source # get :: Get Executable Source # putList :: [Executable] -> Put Source #
NFData Executable # |
Instance details Defined in Distribution.Types.Executable Methods rnf :: Executable -> () Source #
HasBuildInfo Executable # |
Instance details Defined in Distribution.Types.Executable Methods buildInfo :: Lens' Executable BuildInfo # buildable :: Lens' Executable Bool # buildTools :: Lens' Executable [LegacyExeDependency] # buildToolDepends :: Lens' Executable [ExeDependency] # cppOptions :: Lens' Executable [String] # asmOptions :: Lens' Executable [String] # cmmOptions :: Lens' Executable [String] # ccOptions :: Lens' Executable [String] # cxxOptions :: Lens' Executable [String] # ldOptions :: Lens' Executable [String] # pkgconfigDepends :: Lens' Executable [PkgconfigDependency] # frameworks :: Lens' Executable [String] # extraFrameworkDirs :: Lens' Executable [String] # asmSources :: Lens' Executable [FilePath] # cmmSources :: Lens' Executable [FilePath] # cSources :: Lens' Executable [FilePath] # cxxSources :: Lens' Executable [FilePath] # jsSources :: Lens' Executable [FilePath] # hsSourceDirs :: Lens' Executable [FilePath] # otherModules :: Lens' Executable [ModuleName] # virtualModules :: Lens' Executable [ModuleName] # autogenModules :: Lens' Executable [ModuleName] # defaultLanguage :: Lens' Executable (Maybe Language) # otherLanguages :: Lens' Executable [Language] # defaultExtensions :: Lens' Executable [Extension] # otherExtensions :: Lens' Executable [Extension] # oldExtensions :: Lens' Executable [Extension] # extraLibs :: Lens' Executable [String] # extraGHCiLibs :: Lens' Executable [String] # extraBundledLibs :: Lens' Executable [String] # extraLibFlavours :: Lens' Executable [String] # extraLibDirs :: Lens' Executable [String] # includeDirs :: Lens' Executable [FilePath] # includes :: Lens' Executable [FilePath] # installIncludes :: Lens' Executable [FilePath] # options :: Lens' Executable [(CompilerFlavor, [String])] # profOptions :: Lens' Executable [(CompilerFlavor, [String])] # sharedOptions :: Lens' Executable [(CompilerFlavor, [String])] # staticOptions :: Lens' Executable [(CompilerFlavor, [String])] # customFieldsBI :: Lens' Executable [(String, String)] # targetBuildDepends :: Lens' Executable [Dependency] # mixins :: Lens' Executable [Mixin] #
type Rep Executable # |
Instance details Defined in Distribution.Types.Executable type Rep Executable = D1 (MetaData "Executable" "Distribution.Types.Executable" "Cabal-2.4.0.1" False) (C1 (MetaCons "Executable" PrefixI True) ((S1 (MetaSel (Just "exeName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnqualComponentName) :*: S1 (MetaSel (Just "modulePath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath)) :*: (S1 (MetaSel (Just "exeScope") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ExecutableScope) :*: S1 (MetaSel (Just "buildInfo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 BuildInfo))))

emptyExecutable :: Executable #

withExe :: PackageDescription -> (Executable -> IO ()) -> IO () #

Perform the action on each buildable `Executable` in the package description. You probably want `withExeLBI` if you have a `LocalBuildInfo`, see the note in Distribution.Types.ComponentRequestedSpec for more information.

hasExes :: PackageDescription -> Bool #

does this package have any executables?

exeModules :: Executable -> [ModuleName] #

Get all the module names from an exe

exeModulesAutogen :: Executable -> [ModuleName] #

Get all the auto generated module names from an exe This are a subset of `exeModules`.

# Tests

data TestSuite #

A "test-suite" stanza in a cabal file.

Constructors

TestSuite |
Fields testName :: UnqualComponentName testInterface :: TestSuiteInterface testBuildInfo :: BuildInfo

Instances

Eq TestSuite # |
Instance details Defined in Distribution.Types.TestSuite Methods (==) :: TestSuite -> TestSuite -> Bool # (/=) :: TestSuite -> TestSuite -> Bool #
Data TestSuite # |
Instance details Defined in Distribution.Types.TestSuite Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TestSuite -> c TestSuite Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TestSuite Source # toConstr :: TestSuite -> Constr Source # dataTypeOf :: TestSuite -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TestSuite) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TestSuite) Source # gmapT :: (forall b. Data b => b -> b) -> TestSuite -> TestSuite Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TestSuite -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TestSuite -> r Source # gmapQ :: (forall d. Data d => d -> u) -> TestSuite -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> TestSuite -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TestSuite -> m TestSuite Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TestSuite -> m TestSuite Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TestSuite -> m TestSuite Source #
Read TestSuite # |
Instance details Defined in Distribution.Types.TestSuite Methods readsPrec :: Int -> ReadS TestSuite Source # readList :: ReadS [TestSuite] Source # readPrec :: ReadPrec TestSuite Source # readListPrec :: ReadPrec [TestSuite] Source #
Show TestSuite # |
Instance details Defined in Distribution.Types.TestSuite Methods showsPrec :: Int -> TestSuite -> ShowS Source # show :: TestSuite -> String Source # showList :: [TestSuite] -> ShowS Source #
Generic TestSuite # |
Instance details Defined in Distribution.Types.TestSuite Associated Types type Rep TestSuite :: Type -> Type Source # Methods from :: TestSuite -> Rep TestSuite x Source # to :: Rep TestSuite x -> TestSuite Source #
Semigroup TestSuite # |
Instance details Defined in Distribution.Types.TestSuite Methods (<>) :: TestSuite -> TestSuite -> TestSuite Source # sconcat :: NonEmpty TestSuite -> TestSuite Source # stimes :: Integral b => b -> TestSuite -> TestSuite Source #
Monoid TestSuite # |
Instance details Defined in Distribution.Types.TestSuite Methods mempty :: TestSuite Source # mappend :: TestSuite -> TestSuite -> TestSuite Source # mconcat :: [TestSuite] -> TestSuite Source #
Binary TestSuite # |
Instance details Defined in Distribution.Types.TestSuite Methods put :: TestSuite -> Put Source # get :: Get TestSuite Source # putList :: [TestSuite] -> Put Source #
NFData TestSuite # |
Instance details Defined in Distribution.Types.TestSuite Methods rnf :: TestSuite -> () Source #
HasBuildInfo TestSuite # |
Instance details Defined in Distribution.Types.TestSuite Methods buildInfo :: Lens' TestSuite BuildInfo # buildable :: Lens' TestSuite Bool # buildTools :: Lens' TestSuite [LegacyExeDependency] # buildToolDepends :: Lens' TestSuite [ExeDependency] # cppOptions :: Lens' TestSuite [String] # asmOptions :: Lens' TestSuite [String] # cmmOptions :: Lens' TestSuite [String] # ccOptions :: Lens' TestSuite [String] # cxxOptions :: Lens' TestSuite [String] # ldOptions :: Lens' TestSuite [String] # pkgconfigDepends :: Lens' TestSuite [PkgconfigDependency] # frameworks :: Lens' TestSuite [String] # extraFrameworkDirs :: Lens' TestSuite [String] # asmSources :: Lens' TestSuite [FilePath] # cmmSources :: Lens' TestSuite [FilePath] # cSources :: Lens' TestSuite [FilePath] # cxxSources :: Lens' TestSuite [FilePath] # jsSources :: Lens' TestSuite [FilePath] # hsSourceDirs :: Lens' TestSuite [FilePath] # otherModules :: Lens' TestSuite [ModuleName] # virtualModules :: Lens' TestSuite [ModuleName] # autogenModules :: Lens' TestSuite [ModuleName] # defaultLanguage :: Lens' TestSuite (Maybe Language) # otherLanguages :: Lens' TestSuite [Language] # defaultExtensions :: Lens' TestSuite [Extension] # otherExtensions :: Lens' TestSuite [Extension] # oldExtensions :: Lens' TestSuite [Extension] # extraLibs :: Lens' TestSuite [String] # extraGHCiLibs :: Lens' TestSuite [String] # extraBundledLibs :: Lens' TestSuite [String] # extraLibFlavours :: Lens' TestSuite [String] # extraLibDirs :: Lens' TestSuite [String] # includeDirs :: Lens' TestSuite [FilePath] # includes :: Lens' TestSuite [FilePath] # installIncludes :: Lens' TestSuite [FilePath] # options :: Lens' TestSuite [(CompilerFlavor, [String])] # profOptions :: Lens' TestSuite [(CompilerFlavor, [String])] # sharedOptions :: Lens' TestSuite [(CompilerFlavor, [String])] # staticOptions :: Lens' TestSuite [(CompilerFlavor, [String])] # customFieldsBI :: Lens' TestSuite [(String, String)] # targetBuildDepends :: Lens' TestSuite [Dependency] # mixins :: Lens' TestSuite [Mixin] #
type Rep TestSuite # |
Instance details Defined in Distribution.Types.TestSuite type Rep TestSuite = D1 (MetaData "TestSuite" "Distribution.Types.TestSuite" "Cabal-2.4.0.1" False) (C1 (MetaCons "TestSuite" PrefixI True) (S1 (MetaSel (Just "testName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnqualComponentName) :*: (S1 (MetaSel (Just "testInterface") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TestSuiteInterface) :*: S1 (MetaSel (Just "testBuildInfo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 BuildInfo))))

data TestSuiteInterface #

The test suite interfaces that are currently defined. Each test suite must specify which interface it supports.

More interfaces may be defined in future, either new revisions or totally new interfaces.

Constructors

TestSuiteExeV10 Version FilePath | Test interface "exitcode-stdio-1.0". The test-suite takes the form of an executable. It returns a zero exit code for success, non-zero for failure. The stdout and stderr channels may be logged. It takes no command line parameters and nothing on stdin.
TestSuiteLibV09 Version ModuleName | Test interface "detailed-0.9". The test-suite takes the form of a library containing a designated module that exports "tests :: [Test]".
TestSuiteUnsupported TestType | A test suite that does not conform to one of the above interfaces for the given reason (e.g. unknown test type).

Instances

Eq TestSuiteInterface # |
Instance details Defined in Distribution.Types.TestSuiteInterface Methods (==) :: TestSuiteInterface -> TestSuiteInterface -> Bool # (/=) :: TestSuiteInterface -> TestSuiteInterface -> Bool #
Data TestSuiteInterface # |
Instance details Defined in Distribution.Types.TestSuiteInterface Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TestSuiteInterface -> c TestSuiteInterface Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TestSuiteInterface Source # toConstr :: TestSuiteInterface -> Constr Source # dataTypeOf :: TestSuiteInterface -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TestSuiteInterface) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TestSuiteInterface) Source # gmapT :: (forall b. Data b => b -> b) -> TestSuiteInterface -> TestSuiteInterface Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TestSuiteInterface -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TestSuiteInterface -> r Source # gmapQ :: (forall d. Data d => d -> u) -> TestSuiteInterface -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> TestSuiteInterface -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TestSuiteInterface -> m TestSuiteInterface Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TestSuiteInterface -> m TestSuiteInterface Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TestSuiteInterface -> m TestSuiteInterface Source #
Read TestSuiteInterface # |
Instance details Defined in Distribution.Types.TestSuiteInterface Methods readsPrec :: Int -> ReadS TestSuiteInterface Source # readList :: ReadS [TestSuiteInterface] Source # readPrec :: ReadPrec TestSuiteInterface Source # readListPrec :: ReadPrec [TestSuiteInterface] Source #
Show TestSuiteInterface # |
Instance details Defined in Distribution.Types.TestSuiteInterface Methods showsPrec :: Int -> TestSuiteInterface -> ShowS Source # show :: TestSuiteInterface -> String Source # showList :: [TestSuiteInterface] -> ShowS Source #
Generic TestSuiteInterface # |
Instance details Defined in Distribution.Types.TestSuiteInterface Associated Types type Rep TestSuiteInterface :: Type -> Type Source # Methods from :: TestSuiteInterface -> Rep TestSuiteInterface x Source # to :: Rep TestSuiteInterface x -> TestSuiteInterface Source #
Semigroup TestSuiteInterface # |
Instance details Defined in Distribution.Types.TestSuiteInterface Methods (<>) :: TestSuiteInterface -> TestSuiteInterface -> TestSuiteInterface Source # sconcat :: NonEmpty TestSuiteInterface -> TestSuiteInterface Source # stimes :: Integral b => b -> TestSuiteInterface -> TestSuiteInterface Source #
Monoid TestSuiteInterface # |
Instance details Defined in Distribution.Types.TestSuiteInterface Methods mempty :: TestSuiteInterface Source # mappend :: TestSuiteInterface -> TestSuiteInterface -> TestSuiteInterface Source # mconcat :: [TestSuiteInterface] -> TestSuiteInterface Source #
Binary TestSuiteInterface # |
Instance details Defined in Distribution.Types.TestSuiteInterface Methods put :: TestSuiteInterface -> Put Source # get :: Get TestSuiteInterface Source # putList :: [TestSuiteInterface] -> Put Source #
NFData TestSuiteInterface # |
Instance details Defined in Distribution.Types.TestSuiteInterface Methods rnf :: TestSuiteInterface -> () Source #
type Rep TestSuiteInterface # |
Instance details Defined in Distribution.Types.TestSuiteInterface type Rep TestSuiteInterface = D1 (MetaData "TestSuiteInterface" "Distribution.Types.TestSuiteInterface" "Cabal-2.4.0.1" False) (C1 (MetaCons "TestSuiteExeV10" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath)) :+: (C1 (MetaCons "TestSuiteLibV09" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ModuleName)) :+: C1 (MetaCons "TestSuiteUnsupported" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TestType))))

data TestType #

The "test-type" field in the test suite stanza.

Constructors

TestTypeExe Version | "type: exitcode-stdio-x.y"
TestTypeLib Version | "type: detailed-x.y"
TestTypeUnknown String Version | Some unknown test type e.g. "type: foo"

Instances

Eq TestType # |
Instance details Defined in Distribution.Types.TestType Methods (==) :: TestType -> TestType -> Bool # (/=) :: TestType -> TestType -> Bool #
Data TestType # |
Instance details Defined in Distribution.Types.TestType Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TestType -> c TestType Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TestType Source # toConstr :: TestType -> Constr Source # dataTypeOf :: TestType -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TestType) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TestType) Source # gmapT :: (forall b. Data b => b -> b) -> TestType -> TestType Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TestType -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TestType -> r Source # gmapQ :: (forall d. Data d => d -> u) -> TestType -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> TestType -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TestType -> m TestType Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TestType -> m TestType Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TestType -> m TestType Source #
Read TestType # |
Instance details Defined in Distribution.Types.TestType Methods readsPrec :: Int -> ReadS TestType Source # readList :: ReadS [TestType] Source # readPrec :: ReadPrec TestType Source # readListPrec :: ReadPrec [TestType] Source #
Show TestType # |
Instance details Defined in Distribution.Types.TestType Methods showsPrec :: Int -> TestType -> ShowS Source # show :: TestType -> String Source # showList :: [TestType] -> ShowS Source #
Generic TestType # |
Instance details Defined in Distribution.Types.TestType Associated Types type Rep TestType :: Type -> Type Source # Methods from :: TestType -> Rep TestType x Source # to :: Rep TestType x -> TestType Source #
Binary TestType # |
Instance details Defined in Distribution.Types.TestType Methods put :: TestType -> Put Source # get :: Get TestType Source # putList :: [TestType] -> Put Source #
NFData TestType # |
Instance details Defined in Distribution.Types.TestType Methods rnf :: TestType -> () Source #
Pretty TestType # |
Instance details Defined in Distribution.Types.TestType Methods pretty :: TestType -> Doc #
Parsec TestType # |
Instance details Defined in Distribution.Types.TestType Methods parsec :: CabalParsing m => m TestType #
Text TestType # |
Instance details Defined in Distribution.Types.TestType Methods disp :: TestType -> Doc # parse :: ReadP r TestType #
type Rep TestType # |
Instance details Defined in Distribution.Types.TestType type Rep TestType = D1 (MetaData "TestType" "Distribution.Types.TestType" "Cabal-2.4.0.1" False) (C1 (MetaCons "TestTypeExe" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version)) :+: (C1 (MetaCons "TestTypeLib" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version)) :+: C1 (MetaCons "TestTypeUnknown" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version))))

testType :: TestSuite -> TestType #

knownTestTypes :: [TestType] #

emptyTestSuite :: TestSuite #

hasTests :: PackageDescription -> Bool #

Does this package have any test suites?

withTest :: PackageDescription -> (TestSuite -> IO ()) -> IO () #

Perform an action on each buildable `TestSuite` in a package. You probably want `withTestLBI` if you have a `LocalBuildInfo`, see the note in Distribution.Types.ComponentRequestedSpec for more information.

testModules :: TestSuite -> [ModuleName] #

Get all the module names from a test suite.

testModulesAutogen :: TestSuite -> [ModuleName] #

Get all the auto generated module names from a test suite. This are a subset of `testModules`.

# Benchmarks

data Benchmark #

A "benchmark" stanza in a cabal file.

Constructors

Benchmark |
Fields benchmarkName :: UnqualComponentName benchmarkInterface :: BenchmarkInterface benchmarkBuildInfo :: BuildInfo

Instances

Eq Benchmark # |
Instance details Defined in Distribution.Types.Benchmark Methods (==) :: Benchmark -> Benchmark -> Bool # (/=) :: Benchmark -> Benchmark -> Bool #
Data Benchmark # |
Instance details Defined in Distribution.Types.Benchmark Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Benchmark -> c Benchmark Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Benchmark Source # toConstr :: Benchmark -> Constr Source # dataTypeOf :: Benchmark -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Benchmark) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Benchmark) Source # gmapT :: (forall b. Data b => b -> b) -> Benchmark -> Benchmark Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Benchmark -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Benchmark -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Benchmark -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Benchmark -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Benchmark -> m Benchmark Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Benchmark -> m Benchmark Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Benchmark -> m Benchmark Source #
Read Benchmark # |
Instance details Defined in Distribution.Types.Benchmark Methods readsPrec :: Int -> ReadS Benchmark Source # readList :: ReadS [Benchmark] Source # readPrec :: ReadPrec Benchmark Source # readListPrec :: ReadPrec [Benchmark] Source #
Show Benchmark # |
Instance details Defined in Distribution.Types.Benchmark Methods showsPrec :: Int -> Benchmark -> ShowS Source # show :: Benchmark -> String Source # showList :: [Benchmark] -> ShowS Source #
Generic Benchmark # |
Instance details Defined in Distribution.Types.Benchmark Associated Types type Rep Benchmark :: Type -> Type Source # Methods from :: Benchmark -> Rep Benchmark x Source # to :: Rep Benchmark x -> Benchmark Source #
Semigroup Benchmark # |
Instance details Defined in Distribution.Types.Benchmark Methods (<>) :: Benchmark -> Benchmark -> Benchmark Source # sconcat :: NonEmpty Benchmark -> Benchmark Source # stimes :: Integral b => b -> Benchmark -> Benchmark Source #
Monoid Benchmark # |
Instance details Defined in Distribution.Types.Benchmark Methods mempty :: Benchmark Source # mappend :: Benchmark -> Benchmark -> Benchmark Source # mconcat :: [Benchmark] -> Benchmark Source #
Binary Benchmark # |
Instance details Defined in Distribution.Types.Benchmark Methods put :: Benchmark -> Put Source # get :: Get Benchmark Source # putList :: [Benchmark] -> Put Source #
NFData Benchmark # |
Instance details Defined in Distribution.Types.Benchmark Methods rnf :: Benchmark -> () Source #
HasBuildInfo Benchmark # |
Instance details Defined in Distribution.Types.Benchmark Methods buildInfo :: Lens' Benchmark BuildInfo # buildable :: Lens' Benchmark Bool # buildTools :: Lens' Benchmark [LegacyExeDependency] # buildToolDepends :: Lens' Benchmark [ExeDependency] # cppOptions :: Lens' Benchmark [String] # asmOptions :: Lens' Benchmark [String] # cmmOptions :: Lens' Benchmark [String] # ccOptions :: Lens' Benchmark [String] # cxxOptions :: Lens' Benchmark [String] # ldOptions :: Lens' Benchmark [String] # pkgconfigDepends :: Lens' Benchmark [PkgconfigDependency] # frameworks :: Lens' Benchmark [String] # extraFrameworkDirs :: Lens' Benchmark [String] # asmSources :: Lens' Benchmark [FilePath] # cmmSources :: Lens' Benchmark [FilePath] # cSources :: Lens' Benchmark [FilePath] # cxxSources :: Lens' Benchmark [FilePath] # jsSources :: Lens' Benchmark [FilePath] # hsSourceDirs :: Lens' Benchmark [FilePath] # otherModules :: Lens' Benchmark [ModuleName] # virtualModules :: Lens' Benchmark [ModuleName] # autogenModules :: Lens' Benchmark [ModuleName] # defaultLanguage :: Lens' Benchmark (Maybe Language) # otherLanguages :: Lens' Benchmark [Language] # defaultExtensions :: Lens' Benchmark [Extension] # otherExtensions :: Lens' Benchmark [Extension] # oldExtensions :: Lens' Benchmark [Extension] # extraLibs :: Lens' Benchmark [String] # extraGHCiLibs :: Lens' Benchmark [String] # extraBundledLibs :: Lens' Benchmark [String] # extraLibFlavours :: Lens' Benchmark [String] # extraLibDirs :: Lens' Benchmark [String] # includeDirs :: Lens' Benchmark [FilePath] # includes :: Lens' Benchmark [FilePath] # installIncludes :: Lens' Benchmark [FilePath] # options :: Lens' Benchmark [(CompilerFlavor, [String])] # profOptions :: Lens' Benchmark [(CompilerFlavor, [String])] # sharedOptions :: Lens' Benchmark [(CompilerFlavor, [String])] # staticOptions :: Lens' Benchmark [(CompilerFlavor, [String])] # customFieldsBI :: Lens' Benchmark [(String, String)] # targetBuildDepends :: Lens' Benchmark [Dependency] # mixins :: Lens' Benchmark [Mixin] #
type Rep Benchmark # |
Instance details Defined in Distribution.Types.Benchmark type Rep Benchmark = D1 (MetaData "Benchmark" "Distribution.Types.Benchmark" "Cabal-2.4.0.1" False) (C1 (MetaCons "Benchmark" PrefixI True) (S1 (MetaSel (Just "benchmarkName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnqualComponentName) :*: (S1 (MetaSel (Just "benchmarkInterface") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 BenchmarkInterface) :*: S1 (MetaSel (Just "benchmarkBuildInfo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 BuildInfo))))

data BenchmarkInterface #

The benchmark interfaces that are currently defined. Each benchmark must specify which interface it supports.

More interfaces may be defined in future, either new revisions or totally new interfaces.

Constructors

BenchmarkExeV10 Version FilePath | Benchmark interface "exitcode-stdio-1.0". The benchmark takes the form of an executable. It returns a zero exit code for success, non-zero for failure. The stdout and stderr channels may be logged. It takes no command line parameters and nothing on stdin.
BenchmarkUnsupported BenchmarkType | A benchmark that does not conform to one of the above interfaces for the given reason (e.g. unknown benchmark type).

Instances

Eq BenchmarkInterface # |
Instance details Defined in Distribution.Types.BenchmarkInterface Methods (==) :: BenchmarkInterface -> BenchmarkInterface -> Bool # (/=) :: BenchmarkInterface -> BenchmarkInterface -> Bool #
Data BenchmarkInterface # |
Instance details Defined in Distribution.Types.BenchmarkInterface Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BenchmarkInterface -> c BenchmarkInterface Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BenchmarkInterface Source # toConstr :: BenchmarkInterface -> Constr Source # dataTypeOf :: BenchmarkInterface -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BenchmarkInterface) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BenchmarkInterface) Source # gmapT :: (forall b. Data b => b -> b) -> BenchmarkInterface -> BenchmarkInterface Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BenchmarkInterface -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BenchmarkInterface -> r Source # gmapQ :: (forall d. Data d => d -> u) -> BenchmarkInterface -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> BenchmarkInterface -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BenchmarkInterface -> m BenchmarkInterface Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BenchmarkInterface -> m BenchmarkInterface Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BenchmarkInterface -> m BenchmarkInterface Source #
Read BenchmarkInterface # |
Instance details Defined in Distribution.Types.BenchmarkInterface Methods readsPrec :: Int -> ReadS BenchmarkInterface Source # readList :: ReadS [BenchmarkInterface] Source # readPrec :: ReadPrec BenchmarkInterface Source # readListPrec :: ReadPrec [BenchmarkInterface] Source #
Show BenchmarkInterface # |
Instance details Defined in Distribution.Types.BenchmarkInterface Methods showsPrec :: Int -> BenchmarkInterface -> ShowS Source # show :: BenchmarkInterface -> String Source # showList :: [BenchmarkInterface] -> ShowS Source #
Generic BenchmarkInterface # |
Instance details Defined in Distribution.Types.BenchmarkInterface Associated Types type Rep BenchmarkInterface :: Type -> Type Source # Methods from :: BenchmarkInterface -> Rep BenchmarkInterface x Source # to :: Rep BenchmarkInterface x -> BenchmarkInterface Source #
Semigroup BenchmarkInterface # |
Instance details Defined in Distribution.Types.BenchmarkInterface Methods (<>) :: BenchmarkInterface -> BenchmarkInterface -> BenchmarkInterface Source # sconcat :: NonEmpty BenchmarkInterface -> BenchmarkInterface Source # stimes :: Integral b => b -> BenchmarkInterface -> BenchmarkInterface Source #
Monoid BenchmarkInterface # |
Instance details Defined in Distribution.Types.BenchmarkInterface Methods mempty :: BenchmarkInterface Source # mappend :: BenchmarkInterface -> BenchmarkInterface -> BenchmarkInterface Source # mconcat :: [BenchmarkInterface] -> BenchmarkInterface Source #
Binary BenchmarkInterface # |
Instance details Defined in Distribution.Types.BenchmarkInterface Methods put :: BenchmarkInterface -> Put Source # get :: Get BenchmarkInterface Source # putList :: [BenchmarkInterface] -> Put Source #
NFData BenchmarkInterface # |
Instance details Defined in Distribution.Types.BenchmarkInterface Methods rnf :: BenchmarkInterface -> () Source #
type Rep BenchmarkInterface # |
Instance details Defined in Distribution.Types.BenchmarkInterface type Rep BenchmarkInterface = D1 (MetaData "BenchmarkInterface" "Distribution.Types.BenchmarkInterface" "Cabal-2.4.0.1" False) (C1 (MetaCons "BenchmarkExeV10" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath)) :+: C1 (MetaCons "BenchmarkUnsupported" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 BenchmarkType)))

data BenchmarkType #

The "benchmark-type" field in the benchmark stanza.

Constructors

BenchmarkTypeExe Version | "type: exitcode-stdio-x.y"
BenchmarkTypeUnknown String Version | Some unknown benchmark type e.g. "type: foo"

Instances

Eq BenchmarkType # |
Instance details Defined in Distribution.Types.BenchmarkType Methods (==) :: BenchmarkType -> BenchmarkType -> Bool # (/=) :: BenchmarkType -> BenchmarkType -> Bool #
Data BenchmarkType # |
Instance details Defined in Distribution.Types.BenchmarkType Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BenchmarkType -> c BenchmarkType Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BenchmarkType Source # toConstr :: BenchmarkType -> Constr Source # dataTypeOf :: BenchmarkType -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BenchmarkType) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BenchmarkType) Source # gmapT :: (forall b. Data b => b -> b) -> BenchmarkType -> BenchmarkType Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BenchmarkType -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BenchmarkType -> r Source # gmapQ :: (forall d. Data d => d -> u) -> BenchmarkType -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> BenchmarkType -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BenchmarkType -> m BenchmarkType Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BenchmarkType -> m BenchmarkType Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BenchmarkType -> m BenchmarkType Source #
Read BenchmarkType # |
Instance details Defined in Distribution.Types.BenchmarkType Methods readsPrec :: Int -> ReadS BenchmarkType Source # readList :: ReadS [BenchmarkType] Source # readPrec :: ReadPrec BenchmarkType Source # readListPrec :: ReadPrec [BenchmarkType] Source #
Show BenchmarkType # |
Instance details Defined in Distribution.Types.BenchmarkType Methods showsPrec :: Int -> BenchmarkType -> ShowS Source # show :: BenchmarkType -> String Source # showList :: [BenchmarkType] -> ShowS Source #
Generic BenchmarkType # |
Instance details Defined in Distribution.Types.BenchmarkType Associated Types type Rep BenchmarkType :: Type -> Type Source # Methods from :: BenchmarkType -> Rep BenchmarkType x Source # to :: Rep BenchmarkType x -> BenchmarkType Source #
Binary BenchmarkType # |
Instance details Defined in Distribution.Types.BenchmarkType Methods put :: BenchmarkType -> Put Source # get :: Get BenchmarkType Source # putList :: [BenchmarkType] -> Put Source #
NFData BenchmarkType # |
Instance details Defined in Distribution.Types.BenchmarkType Methods rnf :: BenchmarkType -> () Source #
Pretty BenchmarkType # |
Instance details Defined in Distribution.Types.BenchmarkType Methods pretty :: BenchmarkType -> Doc #
Parsec BenchmarkType # |
Instance details Defined in Distribution.Types.BenchmarkType Methods parsec :: CabalParsing m => m BenchmarkType #
Text BenchmarkType # |
Instance details Defined in Distribution.Types.BenchmarkType Methods disp :: BenchmarkType -> Doc # parse :: ReadP r BenchmarkType #
type Rep BenchmarkType # |
Instance details Defined in Distribution.Types.BenchmarkType type Rep BenchmarkType = D1 (MetaData "BenchmarkType" "Distribution.Types.BenchmarkType" "Cabal-2.4.0.1" False) (C1 (MetaCons "BenchmarkTypeExe" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version)) :+: C1 (MetaCons "BenchmarkTypeUnknown" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version)))

benchmarkType :: Benchmark -> BenchmarkType #

knownBenchmarkTypes :: [BenchmarkType] #

emptyBenchmark :: Benchmark #

hasBenchmarks :: PackageDescription -> Bool #

Does this package have any benchmarks?

withBenchmark :: PackageDescription -> (Benchmark -> IO ()) -> IO () #

Perform an action on each buildable `Benchmark` in a package. You probably want `withBenchLBI` if you have a `LocalBuildInfo`, see the note in Distribution.Types.ComponentRequestedSpec for more information.

benchmarkModules :: Benchmark -> [ModuleName] #

Get all the module names from a benchmark.

benchmarkModulesAutogen :: Benchmark -> [ModuleName] #

Get all the auto generated module names from a benchmark. This are a subset of `benchmarkModules`.

# Build information

data BuildInfo #

Constructors

BuildInfo |
Fields buildable :: Bool component is buildable here buildTools :: [LegacyExeDependency] Tools needed to build this bit. This is a legacy field that `buildToolDepends` largely supersedes. Unless use are very sure what you are doing, use the functions in Distribution.Simple.BuildToolDepends rather than accessing this field directly. buildToolDepends :: [ExeDependency] Haskell tools needed to build this bit This field is better than `buildTools` because it allows one to precisely specify an executable in a package. Unless use are very sure what you are doing, use the functions in Distribution.Simple.BuildToolDepends rather than accessing this field directly. cppOptions :: [String] options for pre-processing Haskell code asmOptions :: [String] options for assmebler cmmOptions :: [String] options for C-- compiler ccOptions :: [String] options for C compiler cxxOptions :: [String] options for C++ compiler ldOptions :: [String] options for linker pkgconfigDepends :: [PkgconfigDependency] pkg-config packages that are used frameworks :: [String] support frameworks for Mac OS X extraFrameworkDirs :: [String] extra locations to find frameworks. asmSources :: [FilePath] Assembly files. cmmSources :: [FilePath] C-- files. cSources :: [FilePath] cxxSources :: [FilePath] jsSources :: [FilePath] hsSourceDirs :: [FilePath] where to look for the Haskell module hierarchy otherModules :: [ModuleName] non-exposed or non-main modules virtualModules :: [ModuleName] exposed modules that do not have a source file (e.g. `GHC.Prim` from `ghc-prim` package) autogenModules :: [ModuleName] not present on sdist, Paths_* or user-generated with a custom Setup.hs defaultLanguage :: Maybe Language language used when not explicitly specified otherLanguages :: [Language] other languages used within the package defaultExtensions :: [Extension] language extensions used by all modules otherExtensions :: [Extension] other language extensions used within the package oldExtensions :: [Extension] the old extensions field, treated same as `defaultExtensions` extraLibs :: [String] what libraries to link with when compiling a program that uses your package extraGHCiLibs :: [String] if present, overrides extraLibs when package is loaded with GHCi. extraBundledLibs :: [String] if present, adds libs to hs-lirbaries, which become part of the package. Example: the Cffi library shipping with the rts, alognside the HSrts-1.0.a,.o,... Example 2: a library that is being built by a foreing tool (e.g. rust) and copied and registered together with this library. The logic on how this library is built will have to be encoded in a custom Setup for now. Oherwise cabal would need to lear how to call arbitary lirbary builders. extraLibFlavours :: [String] Hidden Flag. This set of strings, will be appended to all lirbaries when copying. E.g. [libHSname_flavour | flavour <- extraLibFlavours]. This should only be needed in very specific cases, e.g. the `rts` package, where there are multiple copies of slightly differently built libs. extraLibDirs :: [String] includeDirs :: [FilePath] directories to find .h files includes :: [FilePath] The .h files to be found in includeDirs installIncludes :: [FilePath] .h files to install with the package options :: [(CompilerFlavor, [String])] profOptions :: [(CompilerFlavor, [String])] sharedOptions :: [(CompilerFlavor, [String])] staticOptions :: [(CompilerFlavor, [String])] customFieldsBI :: [(String, String)] Custom fields starting with x-, stored in a simple assoc-list. targetBuildDepends :: [Dependency] Dependencies specific to a library or executable target mixins :: [Mixin]

Instances

Eq BuildInfo # |
Instance details Defined in Distribution.Types.BuildInfo Methods (==) :: BuildInfo -> BuildInfo -> Bool # (/=) :: BuildInfo -> BuildInfo -> Bool #
Data BuildInfo # |
Instance details Defined in Distribution.Types.BuildInfo Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuildInfo -> c BuildInfo Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BuildInfo Source # toConstr :: BuildInfo -> Constr Source # dataTypeOf :: BuildInfo -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BuildInfo) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BuildInfo) Source # gmapT :: (forall b. Data b => b -> b) -> BuildInfo -> BuildInfo Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuildInfo -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuildInfo -> r Source # gmapQ :: (forall d. Data d => d -> u) -> BuildInfo -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> BuildInfo -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuildInfo -> m BuildInfo Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuildInfo -> m BuildInfo Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuildInfo -> m BuildInfo Source #
Read BuildInfo # |
Instance details Defined in Distribution.Types.BuildInfo Methods readsPrec :: Int -> ReadS BuildInfo Source # readList :: ReadS [BuildInfo] Source # readPrec :: ReadPrec BuildInfo Source # readListPrec :: ReadPrec [BuildInfo] Source #
Show BuildInfo # |
Instance details Defined in Distribution.Types.BuildInfo Methods showsPrec :: Int -> BuildInfo -> ShowS Source # show :: BuildInfo -> String Source # showList :: [BuildInfo] -> ShowS Source #
Generic BuildInfo # |
Instance details Defined in Distribution.Types.BuildInfo Associated Types type Rep BuildInfo :: Type -> Type Source # Methods from :: BuildInfo -> Rep BuildInfo x Source # to :: Rep BuildInfo x -> BuildInfo Source #
Semigroup BuildInfo # |
Instance details Defined in Distribution.Types.BuildInfo Methods (<>) :: BuildInfo -> BuildInfo -> BuildInfo Source # sconcat :: NonEmpty BuildInfo -> BuildInfo Source # stimes :: Integral b => b -> BuildInfo -> BuildInfo Source #
Monoid BuildInfo # |
Instance details Defined in Distribution.Types.BuildInfo Methods mempty :: BuildInfo Source # mappend :: BuildInfo -> BuildInfo -> BuildInfo Source # mconcat :: [BuildInfo] -> BuildInfo Source #
Binary BuildInfo # |
Instance details Defined in Distribution.Types.BuildInfo Methods put :: BuildInfo -> Put Source # get :: Get BuildInfo Source # putList :: [BuildInfo] -> Put Source #
NFData BuildInfo # |
Instance details Defined in Distribution.Types.BuildInfo Methods rnf :: BuildInfo -> () Source #
HasBuildInfo BuildInfo # |
Instance details Defined in Distribution.Types.BuildInfo.Lens Methods buildInfo :: Lens' BuildInfo BuildInfo # buildable :: Lens' BuildInfo Bool # buildTools :: Lens' BuildInfo [LegacyExeDependency] # buildToolDepends :: Lens' BuildInfo [ExeDependency] # cppOptions :: Lens' BuildInfo [String] # asmOptions :: Lens' BuildInfo [String] # cmmOptions :: Lens' BuildInfo [String] # ccOptions :: Lens' BuildInfo [String] # cxxOptions :: Lens' BuildInfo [String] # ldOptions :: Lens' BuildInfo [String] # pkgconfigDepends :: Lens' BuildInfo [PkgconfigDependency] # frameworks :: Lens' BuildInfo [String] # extraFrameworkDirs :: Lens' BuildInfo [String] # asmSources :: Lens' BuildInfo [FilePath] # cmmSources :: Lens' BuildInfo [FilePath] # cSources :: Lens' BuildInfo [FilePath] # cxxSources :: Lens' BuildInfo [FilePath] # jsSources :: Lens' BuildInfo [FilePath] # hsSourceDirs :: Lens' BuildInfo [FilePath] # otherModules :: Lens' BuildInfo [ModuleName] # virtualModules :: Lens' BuildInfo [ModuleName] # autogenModules :: Lens' BuildInfo [ModuleName] # defaultLanguage :: Lens' BuildInfo (Maybe Language) # otherLanguages :: Lens' BuildInfo [Language] # defaultExtensions :: Lens' BuildInfo [Extension] # otherExtensions :: Lens' BuildInfo [Extension] # oldExtensions :: Lens' BuildInfo [Extension] # extraLibs :: Lens' BuildInfo [String] # extraGHCiLibs :: Lens' BuildInfo [String] # extraBundledLibs :: Lens' BuildInfo [String] # extraLibFlavours :: Lens' BuildInfo [String] # extraLibDirs :: Lens' BuildInfo [String] # includeDirs :: Lens' BuildInfo [FilePath] # includes :: Lens' BuildInfo [FilePath] # installIncludes :: Lens' BuildInfo [FilePath] # options :: Lens' BuildInfo [(CompilerFlavor, [String])] # profOptions :: Lens' BuildInfo [(CompilerFlavor, [String])] # sharedOptions :: Lens' BuildInfo [(CompilerFlavor, [String])] # staticOptions :: Lens' BuildInfo [(CompilerFlavor, [String])] # customFieldsBI :: Lens' BuildInfo [(String, String)] # targetBuildDepends :: Lens' BuildInfo [Dependency] # mixins :: Lens' BuildInfo [Mixin] #
type Rep BuildInfo # |
Instance details Defined in Distribution.Types.BuildInfo type Rep BuildInfo = D1 (MetaData "BuildInfo" "Distribution.Types.BuildInfo" "Cabal-2.4.0.1" False) (C1 (MetaCons "BuildInfo" PrefixI True) (((((S1 (MetaSel (Just "buildable") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "buildTools") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [LegacyExeDependency])) :*: (S1 (MetaSel (Just "buildToolDepends") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ExeDependency]) :*: (S1 (MetaSel (Just "cppOptions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]) :*: S1 (MetaSel (Just "asmOptions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String])))) :*: ((S1 (MetaSel (Just "cmmOptions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]) :*: S1 (MetaSel (Just "ccOptions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String])) :*: (S1 (MetaSel (Just "cxxOptions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]) :*: (S1 (MetaSel (Just "ldOptions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]) :*: S1 (MetaSel (Just "pkgconfigDepends") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [PkgconfigDependency]))))) :*: (((S1 (MetaSel (Just "frameworks") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]) :*: S1 (MetaSel (Just "extraFrameworkDirs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String])) :*: (S1 (MetaSel (Just "asmSources") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath]) :*: (S1 (MetaSel (Just "cmmSources") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath]) :*: S1 (MetaSel (Just "cSources") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath])))) :*: ((S1 (MetaSel (Just "cxxSources") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath]) :*: S1 (MetaSel (Just "jsSources") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath])) :*: (S1 (MetaSel (Just "hsSourceDirs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath]) :*: (S1 (MetaSel (Just "otherModules") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ModuleName]) :*: S1 (MetaSel (Just "virtualModules") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ModuleName])))))) :*: ((((S1 (MetaSel (Just "autogenModules") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ModuleName]) :*: S1 (MetaSel (Just "defaultLanguage") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Language))) :*: (S1 (MetaSel (Just "otherLanguages") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Language]) :*: (S1 (MetaSel (Just "defaultExtensions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Extension]) :*: S1 (MetaSel (Just "otherExtensions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Extension])))) :*: ((S1 (MetaSel (Just "oldExtensions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Extension]) :*: S1 (MetaSel (Just "extraLibs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String])) :*: (S1 (MetaSel (Just "extraGHCiLibs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]) :*: (S1 (MetaSel (Just "extraBundledLibs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]) :*: S1 (MetaSel (Just "extraLibFlavours") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]))))) :*: (((S1 (MetaSel (Just "extraLibDirs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]) :*: S1 (MetaSel (Just "includeDirs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath])) :*: (S1 (MetaSel (Just "includes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath]) :*: (S1 (MetaSel (Just "installIncludes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath]) :*: S1 (MetaSel (Just "options") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(CompilerFlavor, [String])])))) :*: ((S1 (MetaSel (Just "profOptions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(CompilerFlavor, [String])]) :*: (S1 (MetaSel (Just "sharedOptions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(CompilerFlavor, [String])]) :*: S1 (MetaSel (Just "staticOptions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(CompilerFlavor, [String])]))) :*: (S1 (MetaSel (Just "customFieldsBI") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(String, String)]) :*: (S1 (MetaSel (Just "targetBuildDepends") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Dependency]) :*: S1 (MetaSel (Just "mixins") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Mixin]))))))))

emptyBuildInfo :: BuildInfo #

allBuildInfo :: PackageDescription -> [BuildInfo] #

All `BuildInfo` in the `PackageDescription`: libraries, executables, test-suites and benchmarks.

Useful for implementing package checks.

allLanguages :: BuildInfo -> [Language] #

The `Language`s used by this component

allExtensions :: BuildInfo -> [Extension] #

The `Extension`s that are used somewhere by this component

usedExtensions :: BuildInfo -> [Extension] #

The `Extensions` that are used by all modules in this component

usesTemplateHaskellOrQQ :: BuildInfo -> Bool #

Whether any modules in this component use Template Haskell or Quasi Quotes

hcOptions :: CompilerFlavor -> BuildInfo -> [String] #

Select options for a particular Haskell compiler.

hcProfOptions :: CompilerFlavor -> BuildInfo -> [String] #

hcSharedOptions :: CompilerFlavor -> BuildInfo -> [String] #

hcStaticOptions :: CompilerFlavor -> BuildInfo -> [String] #

## Supplementary build information

allBuildDepends :: PackageDescription -> [Dependency] #

Get the combined build-depends entries of all components.

enabledBuildDepends :: PackageDescription -> ComponentRequestedSpec -> [Dependency] #

Get the combined build-depends entries of all enabled components, per the given request spec.

data ComponentName #

Constructors

CLibName |
CSubLibName UnqualComponentName |
CFLibName UnqualComponentName |
CExeName UnqualComponentName |
CTestName UnqualComponentName |
CBenchName UnqualComponentName |

Instances

Eq ComponentName # |
Instance details Defined in Distribution.Types.ComponentName Methods (==) :: ComponentName -> ComponentName -> Bool # (/=) :: ComponentName -> ComponentName -> Bool #
Ord ComponentName # |
Instance details Defined in Distribution.Types.ComponentName Methods compare :: ComponentName -> ComponentName -> Ordering # (<) :: ComponentName -> ComponentName -> Bool # (<=) :: ComponentName -> ComponentName -> Bool # (>) :: ComponentName -> ComponentName -> Bool # (>=) :: ComponentName -> ComponentName -> Bool # max :: ComponentName -> ComponentName -> ComponentName # min :: ComponentName -> ComponentName -> ComponentName #
Read ComponentName # |
Instance details Defined in Distribution.Types.ComponentName Methods readsPrec :: Int -> ReadS ComponentName Source # readList :: ReadS [ComponentName] Source # readPrec :: ReadPrec ComponentName Source # readListPrec :: ReadPrec [ComponentName] Source #
Show ComponentName # |
Instance details Defined in Distribution.Types.ComponentName Methods showsPrec :: Int -> ComponentName -> ShowS Source # show :: ComponentName -> String Source # showList :: [ComponentName] -> ShowS Source #
Generic ComponentName # |
Instance details Defined in Distribution.Types.ComponentName Associated Types type Rep ComponentName :: Type -> Type Source # Methods from :: ComponentName -> Rep ComponentName x Source # to :: Rep ComponentName x -> ComponentName Source #
Binary ComponentName # |
Instance details Defined in Distribution.Types.ComponentName Methods put :: ComponentName -> Put Source # get :: Get ComponentName Source # putList :: [ComponentName] -> Put Source #
Pretty ComponentName # |
Instance details Defined in Distribution.Types.ComponentName Methods pretty :: ComponentName -> Doc #
Text ComponentName # |
Instance details Defined in Distribution.Types.ComponentName Methods disp :: ComponentName -> Doc # parse :: ReadP r ComponentName #
type Rep ComponentName # |
Instance details Defined in Distribution.Types.ComponentName type Rep ComponentName = D1 (MetaData "ComponentName" "Distribution.Types.ComponentName" "Cabal-2.4.0.1" False) ((C1 (MetaCons "CLibName" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "CSubLibName" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnqualComponentName)) :+: C1 (MetaCons "CFLibName" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnqualComponentName)))) :+: (C1 (MetaCons "CExeName" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnqualComponentName)) :+: (C1 (MetaCons "CTestName" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnqualComponentName)) :+: C1 (MetaCons "CBenchName" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnqualComponentName)))))

defaultLibName :: ComponentName #

type HookedBuildInfo = (Maybe BuildInfo, [(UnqualComponentName, BuildInfo)]) #

`HookedBuildInfo` is mechanism that hooks can use to override the `BuildInfo`s inside packages. One example use-case (which is used in core libraries today) is as a way of passing flags which are computed by a configure script into Cabal. In this case, the autoconf build type adds hooks to read in a textual `HookedBuildInfo` format prior to doing any operations.

Quite honestly, this mechanism is a massive hack since we shouldn't be editing the `PackageDescription` data structure (it's easy to assume that this data structure shouldn't change and run into bugs, see for example 1c20a6328579af9e37677d507e2e9836ef70ab9d). But it's a bit convenient, because there isn't another data structure that allows adding extra `BuildInfo` style things.

In any case, a lot of care has to be taken to make sure the `HookedBuildInfo` is applied to the `PackageDescription`. In general this process occurs in Distribution.Simple, which is responsible for orchestrating the hooks mechanism. The general strategy:

1. We run the pre-hook, which produces a `HookedBuildInfo` (e.g., in the Autoconf case, it reads it out from a file).
2. We sanity-check the hooked build info with `sanityCheckHookedBuildInfo`.
3. We update our `PackageDescription` (either freshly read or cached from `LocalBuildInfo`) with `updatePackageDescription`.

In principle, we are also supposed to update the copy of the `PackageDescription` stored in `LocalBuildInfo` at `localPkgDescr`. Unfortunately, in practice, there are lots of Custom setup scripts which fail to update `localPkgDescr` so you really shouldn't rely on it. It's not DEPRECATED because there are legitimate uses for it, but... yeah. Sharp knife. See https://github.com/haskell/cabal/issues/3606 for more information on the issue.

It is not well-specified whether or not a `HookedBuildInfo` applied at configure time is persistent to the `LocalBuildInfo`. The fact that `HookedBuildInfo` is passed to `confHook` MIGHT SUGGEST that the `HookedBuildInfo` is applied at this time, but actually since 9317b67e6122ab14e53f81b573bd0ecb388eca5a it has been ONLY used to create a modified package description that we check for problems: it is never actually saved to the LBI. Since `HookedBuildInfo` is applied monoidally to the existing build infos (and it is not an idempotent monoid), it could break things to save it, since we are obligated to apply any new `HookedBuildInfo` and then we'd get the effect twice. But this does mean we have to re-apply it every time. Hey, it's more flexibility.

emptyHookedBuildInfo :: HookedBuildInfo #

updatePackageDescription :: HookedBuildInfo -> PackageDescription -> PackageDescription #

# package configuration

data GenericPackageDescription #

Constructors

GenericPackageDescription |
Fields packageDescription :: PackageDescription genPackageFlags :: [Flag] condLibrary :: Maybe (CondTree ConfVar [Dependency] Library) condSubLibraries :: [(UnqualComponentName, CondTree ConfVar [Dependency] Library)] condForeignLibs :: [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)] condExecutables :: [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)] condTestSuites :: [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)] condBenchmarks :: [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]

Instances

Eq GenericPackageDescription # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods (==) :: GenericPackageDescription -> GenericPackageDescription -> Bool # (/=) :: GenericPackageDescription -> GenericPackageDescription -> Bool #
Data GenericPackageDescription # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GenericPackageDescription -> c GenericPackageDescription Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GenericPackageDescription Source # toConstr :: GenericPackageDescription -> Constr Source # dataTypeOf :: GenericPackageDescription -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c GenericPackageDescription) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GenericPackageDescription) Source # gmapT :: (forall b. Data b => b -> b) -> GenericPackageDescription -> GenericPackageDescription Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GenericPackageDescription -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GenericPackageDescription -> r Source # gmapQ :: (forall d. Data d => d -> u) -> GenericPackageDescription -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> GenericPackageDescription -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> GenericPackageDescription -> m GenericPackageDescription Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GenericPackageDescription -> m GenericPackageDescription Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GenericPackageDescription -> m GenericPackageDescription Source #
Show GenericPackageDescription # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods showsPrec :: Int -> GenericPackageDescription -> ShowS Source # show :: GenericPackageDescription -> String Source # showList :: [GenericPackageDescription] -> ShowS Source #
Generic GenericPackageDescription # |
Instance details Defined in Distribution.Types.GenericPackageDescription Associated Types type Rep GenericPackageDescription :: Type -> Type Source # Methods from :: GenericPackageDescription -> Rep GenericPackageDescription x Source # to :: Rep GenericPackageDescription x -> GenericPackageDescription Source #
Binary GenericPackageDescription # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods put :: GenericPackageDescription -> Put Source # get :: Get GenericPackageDescription Source # putList :: [GenericPackageDescription] -> Put Source #
NFData GenericPackageDescription # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods rnf :: GenericPackageDescription -> () Source #
Package GenericPackageDescription # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods packageId :: GenericPackageDescription -> PackageIdentifier #
HasBuildInfos GenericPackageDescription # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods traverseBuildInfos :: Traversal' GenericPackageDescription BuildInfo #
type Rep GenericPackageDescription # |
Instance details Defined in Distribution.Types.GenericPackageDescription type Rep GenericPackageDescription = D1 (MetaData "GenericPackageDescription" "Distribution.Types.GenericPackageDescription" "Cabal-2.4.0.1" False) (C1 (MetaCons "GenericPackageDescription" PrefixI True) (((S1 (MetaSel (Just "packageDescription") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 PackageDescription) :*: S1 (MetaSel (Just "genPackageFlags") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Flag])) :*: (S1 (MetaSel (Just "condLibrary") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (CondTree ConfVar [Dependency] Library))) :*: S1 (MetaSel (Just "condSubLibraries") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]))) :*: ((S1 (MetaSel (Just "condForeignLibs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)]) :*: S1 (MetaSel (Just "condExecutables") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)])) :*: (S1 (MetaSel (Just "condTestSuites") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]) :*: S1 (MetaSel (Just "condBenchmarks") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)])))))

data Flag #

A flag can represent a feature to be included, or a way of linking a target against its dependencies, or in fact whatever you can think of.

Constructors

MkFlag |
Fields flagName :: FlagName flagDescription :: String flagDefault :: Bool flagManual :: Bool

Instances

Eq Flag # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods (==) :: Flag -> Flag -> Bool # (/=) :: Flag -> Flag -> Bool #
Data Flag # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Flag -> c Flag Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Flag Source # toConstr :: Flag -> Constr Source # dataTypeOf :: Flag -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Flag) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Flag) Source # gmapT :: (forall b. Data b => b -> b) -> Flag -> Flag Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Flag -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Flag -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Flag -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Flag -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Flag -> m Flag Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Flag -> m Flag Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Flag -> m Flag Source #
Show Flag # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods showsPrec :: Int -> Flag -> ShowS Source # show :: Flag -> String Source # showList :: [Flag] -> ShowS Source #
Generic Flag # |
Instance details Defined in Distribution.Types.GenericPackageDescription Associated Types type Rep Flag :: Type -> Type Source # Methods from :: Flag -> Rep Flag x Source # to :: Rep Flag x -> Flag Source #
Binary Flag # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods put :: Flag -> Put Source # get :: Get Flag Source # putList :: [Flag] -> Put Source #
NFData Flag # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods rnf :: Flag -> () Source #
type Rep Flag # |
Instance details Defined in Distribution.Types.GenericPackageDescription type Rep Flag = D1 (MetaData "Flag" "Distribution.Types.GenericPackageDescription" "Cabal-2.4.0.1" False) (C1 (MetaCons "MkFlag" PrefixI True) ((S1 (MetaSel (Just "flagName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FlagName) :*: S1 (MetaSel (Just "flagDescription") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) :*: (S1 (MetaSel (Just "flagDefault") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "flagManual") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))))

emptyFlag :: FlagName -> Flag #

A `Flag` initialized with default parameters.

data FlagName #

A `FlagName` is the name of a user-defined configuration flag

Use `mkFlagName` and `unFlagName` to convert from/to a `String`.

This type is opaque since `Cabal-2.0`

Since: Cabal-2.0.0.2

Instances

Eq FlagName # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods (==) :: FlagName -> FlagName -> Bool # (/=) :: FlagName -> FlagName -> Bool #
Data FlagName # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FlagName -> c FlagName Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FlagName Source # toConstr :: FlagName -> Constr Source # dataTypeOf :: FlagName -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FlagName) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FlagName) Source # gmapT :: (forall b. Data b => b -> b) -> FlagName -> FlagName Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FlagName -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FlagName -> r Source # gmapQ :: (forall d. Data d => d -> u) -> FlagName -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> FlagName -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FlagName -> m FlagName Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FlagName -> m FlagName Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FlagName -> m FlagName Source #
Ord FlagName # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods compare :: FlagName -> FlagName -> Ordering # (<) :: FlagName -> FlagName -> Bool # (<=) :: FlagName -> FlagName -> Bool # (>) :: FlagName -> FlagName -> Bool # (>=) :: FlagName -> FlagName -> Bool # max :: FlagName -> FlagName -> FlagName # min :: FlagName -> FlagName -> FlagName #
Read FlagName # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods readsPrec :: Int -> ReadS FlagName Source # readList :: ReadS [FlagName] Source # readPrec :: ReadPrec FlagName Source # readListPrec :: ReadPrec [FlagName] Source #
Show FlagName # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods showsPrec :: Int -> FlagName -> ShowS Source # show :: FlagName -> String Source # showList :: [FlagName] -> ShowS Source #
IsString FlagName # | `mkFlagName` Since: Cabal-2.0.0.2
Instance details Defined in Distribution.Types.GenericPackageDescription Methods fromString :: String -> FlagName Source #
Generic FlagName # |
Instance details Defined in Distribution.Types.GenericPackageDescription Associated Types type Rep FlagName :: Type -> Type Source # Methods from :: FlagName -> Rep FlagName x Source # to :: Rep FlagName x -> FlagName Source #
Binary FlagName # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods put :: FlagName -> Put Source # get :: Get FlagName Source # putList :: [FlagName] -> Put Source #
NFData FlagName # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods rnf :: FlagName -> () Source #
Pretty FlagName # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods pretty :: FlagName -> Doc #
Parsec FlagName # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods parsec :: CabalParsing m => m FlagName #
Text FlagName # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods disp :: FlagName -> Doc # parse :: ReadP r FlagName #
type Rep FlagName # |
Instance details Defined in Distribution.Types.GenericPackageDescription type Rep FlagName = D1 (MetaData "FlagName" "Distribution.Types.GenericPackageDescription" "Cabal-2.4.0.1" True) (C1 (MetaCons "FlagName" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ShortText)))

mkFlagName :: String -> FlagName #

Construct a `FlagName` from a `String`

`mkFlagName` is the inverse to `unFlagName`

Note: No validations are performed to ensure that the resulting `FlagName` is valid

Since: Cabal-2.0.0.2

unFlagName :: FlagName -> String #

Convert `FlagName` to `String`

Since: Cabal-2.0.0.2

data FlagAssignment #

A `FlagAssignment` is a total or partial mapping of `FlagName`s to `Bool` flag values. It represents the flags chosen by the user or discovered during configuration. For example `--flags=foo --flags=-bar` becomes `[("foo", True), ("bar", False)]`

Instances

Eq FlagAssignment # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods (==) :: FlagAssignment -> FlagAssignment -> Bool # (/=) :: FlagAssignment -> FlagAssignment -> Bool #
Ord FlagAssignment # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods compare :: FlagAssignment -> FlagAssignment -> Ordering # (<) :: FlagAssignment -> FlagAssignment -> Bool # (<=) :: FlagAssignment -> FlagAssignment -> Bool # (>) :: FlagAssignment -> FlagAssignment -> Bool # (>=) :: FlagAssignment -> FlagAssignment -> Bool # max :: FlagAssignment -> FlagAssignment -> FlagAssignment # min :: FlagAssignment -> FlagAssignment -> FlagAssignment #
Read FlagAssignment # | Since: Cabal-2.2.0
Instance details Defined in Distribution.Types.GenericPackageDescription Methods readsPrec :: Int -> ReadS FlagAssignment Source # readList :: ReadS [FlagAssignment] Source # readPrec :: ReadPrec FlagAssignment Source # readListPrec :: ReadPrec [FlagAssignment] Source #
Show FlagAssignment # | Since: Cabal-2.2.0
Instance details Defined in Distribution.Types.GenericPackageDescription Methods showsPrec :: Int -> FlagAssignment -> ShowS Source # show :: FlagAssignment -> String Source # showList :: [FlagAssignment] -> ShowS Source #
Generic FlagAssignment # |
Instance details Defined in Distribution.Types.GenericPackageDescription Associated Types type Rep FlagAssignment :: Type -> Type Source # Methods from :: FlagAssignment -> Rep FlagAssignment x Source # to :: Rep FlagAssignment x -> FlagAssignment Source #
Semigroup FlagAssignment # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods (<>) :: FlagAssignment -> FlagAssignment -> FlagAssignment Source # sconcat :: NonEmpty FlagAssignment -> FlagAssignment Source # stimes :: Integral b => b -> FlagAssignment -> FlagAssignment Source #
Monoid FlagAssignment # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods mempty :: FlagAssignment Source # mappend :: FlagAssignment -> FlagAssignment -> FlagAssignment Source # mconcat :: [FlagAssignment] -> FlagAssignment Source #
Binary FlagAssignment # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods put :: FlagAssignment -> Put Source # get :: Get FlagAssignment Source # putList :: [FlagAssignment] -> Put Source #
NFData FlagAssignment # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods rnf :: FlagAssignment -> () Source #
type Rep FlagAssignment # |
Instance details Defined in Distribution.Types.GenericPackageDescription type Rep FlagAssignment = D1 (MetaData "FlagAssignment" "Distribution.Types.GenericPackageDescription" "Cabal-2.4.0.1" True) (C1 (MetaCons "FlagAssignment" PrefixI True) (S1 (MetaSel (Just "getFlagAssignment") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map FlagName (Int, Bool)))))

mkFlagAssignment :: [(FlagName, Bool)] -> FlagAssignment #

Construct a `FlagAssignment` from a list of flag/value pairs.

If duplicate flags occur in the input list, the later entries in the list will take precedence.

Since: Cabal-2.2.0

unFlagAssignment :: FlagAssignment -> [(FlagName, Bool)] #

Deconstruct a `FlagAssignment` into a list of flag/value pairs.

     null (findDuplicateFlagAssignments fa) ==> (mkFlagAssignment . unFlagAssignment) fa == fa

Since: Cabal-2.2.0

nullFlagAssignment :: FlagAssignment -> Bool #

Test whether `FlagAssignment` is empty.

Since: Cabal-2.2.0

showFlagValue :: (FlagName, Bool) -> String #

String representation of a flag-value pair.

diffFlagAssignment :: FlagAssignment -> FlagAssignment -> FlagAssignment #

Remove all flag-assignments from the first `FlagAssignment` that are contained in the second `FlagAssignment`

NB/TODO: This currently only removes flag assignments which also match the value assignment! We should review the code which uses this operation to figure out if this it's not enough to only compare the flagnames without the values.

Since: Cabal-2.2.0

lookupFlagAssignment :: FlagName -> FlagAssignment -> Maybe Bool #

Lookup the value for a flag

Returns `Nothing` if the flag isn't contained in the `FlagAssignment`.

Since: Cabal-2.2.0

insertFlagAssignment :: FlagName -> Bool -> FlagAssignment -> FlagAssignment #

Insert or update the boolean value of a flag.

If the flag is already present in the `FlagAssigment`, the value will be updated and the fact that multiple values have been provided for that flag will be recorded so that a warning can be generated later on.

Since: Cabal-2.2.0

dispFlagAssignment :: FlagAssignment -> Doc #

Pretty-prints a flag assignment.

parseFlagAssignment :: ReadP r FlagAssignment #

Parses a flag assignment.

parsecFlagAssignment :: ParsecParser FlagAssignment #

Parses a flag assignment.

findDuplicateFlagAssignments :: FlagAssignment -> [FlagName] #

Find the `FlagName`s that have been listed more than once.

Since: Cabal-2.2.0

data CondTree v c a #

A `CondTree` is used to represent the conditional structure of a Cabal file, reflecting a syntax element subject to constraints, and then any number of sub-elements which may be enabled subject to some condition. Both `a` and `c` are usually `Monoid`s.

To be more concrete, consider the following fragment of a `Cabal` file:

    build-depends: base >= 4.0
    if flag(extra)
        build-depends: base >= 4.2

One way to represent this is to have ``CondTree` `ConfVar` [`Dependency`] `BuildInfo``. Here, `condTreeData` represents the actual fields which are not behind any conditional, while `condTreeComponents` recursively records any further fields which are behind a conditional. `condTreeConstraints` records the constraints (in this case, `base >= 4.0`) which would be applied if you use this syntax; in general, this is derived off of `targetBuildInfo` (perhaps a good refactoring would be to convert this into an opaque type, with a smart constructor that pre-computes the dependencies.)

Constructors

CondNode |
Fields condTreeData :: a condTreeConstraints :: c condTreeComponents :: [CondBranch v c a]

Instances

Functor (CondTree v c) # |
Instance details Defined in Distribution.Types.CondTree Methods fmap :: (a -> b) -> CondTree v c a -> CondTree v c b Source # (<$) :: a -> CondTree v c b -> CondTree v c a Source #
Foldable (CondTree v c) # |
Instance details Defined in Distribution.Types.CondTree Methods fold :: Monoid m => CondTree v c m -> m Source # foldMap :: Monoid m => (a -> m) -> CondTree v c a -> m Source # foldr :: (a -> b -> b) -> b -> CondTree v c a -> b Source # foldr' :: (a -> b -> b) -> b -> CondTree v c a -> b Source # foldl :: (b -> a -> b) -> b -> CondTree v c a -> b Source # foldl' :: (b -> a -> b) -> b -> CondTree v c a -> b Source # foldr1 :: (a -> a -> a) -> CondTree v c a -> a Source # foldl1 :: (a -> a -> a) -> CondTree v c a -> a Source # toList :: CondTree v c a -> [a] Source # null :: CondTree v c a -> Bool Source # length :: CondTree v c a -> Int Source # elem :: Eq a => a -> CondTree v c a -> Bool Source # maximum :: Ord a => CondTree v c a -> a Source # minimum :: Ord a => CondTree v c a -> a Source # sum :: Num a => CondTree v c a -> a Source # product :: Num a => CondTree v c a -> a Source #
Traversable (CondTree v c) # |
Instance details Defined in Distribution.Types.CondTree Methods traverse :: Applicative f => (a -> f b) -> CondTree v c a -> f (CondTree v c b) Source # sequenceA :: Applicative f => CondTree v c (f a) -> f (CondTree v c a) Source # mapM :: Monad m => (a -> m b) -> CondTree v c a -> m (CondTree v c b) Source # sequence :: Monad m => CondTree v c (m a) -> m (CondTree v c a) Source #
(Eq a, Eq c, Eq v) => Eq (CondTree v c a) # |
Instance details Defined in Distribution.Types.CondTree Methods (==) :: CondTree v c a -> CondTree v c a -> Bool # (/=) :: CondTree v c a -> CondTree v c a -> Bool #
(Data v, Data c, Data a) => Data (CondTree v c a) # |
Instance details Defined in Distribution.Types.CondTree Methods gfoldl :: (forall d b. Data d => c0 (d -> b) -> d -> c0 b) -> (forall g. g -> c0 g) -> CondTree v c a -> c0 (CondTree v c a) Source # gunfold :: (forall b r. Data b => c0 (b -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (CondTree v c a) Source # toConstr :: CondTree v c a -> Constr Source # dataTypeOf :: CondTree v c a -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c0 (t d)) -> Maybe (c0 (CondTree v c a)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c0 (t d e)) -> Maybe (c0 (CondTree v c a)) Source # gmapT :: (forall b. Data b => b -> b) -> CondTree v c a -> CondTree v c a Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CondTree v c a -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CondTree v c a -> r Source # gmapQ :: (forall d. Data d => d -> u) -> CondTree v c a -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> CondTree v c a -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CondTree v c a -> m (CondTree v c a) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CondTree v c a -> m (CondTree v c a) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CondTree v c a -> m (CondTree v c a) Source #
(Show a, Show c, Show v) => Show (CondTree v c a) # |
Instance details Defined in Distribution.Types.CondTree Methods showsPrec :: Int -> CondTree v c a -> ShowS Source # show :: CondTree v c a -> String Source # showList :: [CondTree v c a] -> ShowS Source #
Generic (CondTree v c a) # |
Instance details Defined in Distribution.Types.CondTree Associated Types type Rep (CondTree v c a) :: Type -> Type Source # Methods from :: CondTree v c a -> Rep (CondTree v c a) x Source # to :: Rep (CondTree v c a) x -> CondTree v c a Source #
(Binary v, Binary c, Binary a) => Binary (CondTree v c a) # |
Instance details Defined in Distribution.Types.CondTree Methods put :: CondTree v c a -> Put Source # get :: Get (CondTree v c a) Source # putList :: [CondTree v c a] -> Put Source #
(NFData v, NFData c, NFData a) => NFData (CondTree v c a) # |
Instance details Defined in Distribution.Types.CondTree Methods rnf :: CondTree v c a -> () Source #
type Rep (CondTree v c a) # |
Instance details Defined in Distribution.Types.CondTree type Rep (CondTree v c a) = D1 (MetaData "CondTree" "Distribution.Types.CondTree" "Cabal-2.4.0.1" False) (C1 (MetaCons "CondNode" PrefixI True) (S1 (MetaSel (Just "condTreeData") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a) :*: (S1 (MetaSel (Just "condTreeConstraints") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 c) :*: S1 (MetaSel (Just "condTreeComponents") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [CondBranch v c a]))))

data ConfVar #

A `ConfVar` represents the variable type used.

Constructors

OS OS |
Arch Arch |
Flag FlagName |
Impl CompilerFlavor VersionRange |

Instances

Eq ConfVar # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods (==) :: ConfVar -> ConfVar -> Bool # (/=) :: ConfVar -> ConfVar -> Bool #
Data ConfVar # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ConfVar -> c ConfVar Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ConfVar Source # toConstr :: ConfVar -> Constr Source # dataTypeOf :: ConfVar -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ConfVar) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConfVar) Source # gmapT :: (forall b. Data b => b -> b) -> ConfVar -> ConfVar Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ConfVar -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ConfVar -> r Source # gmapQ :: (forall d. Data d => d -> u) -> ConfVar -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> ConfVar -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ConfVar -> m ConfVar Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ConfVar -> m ConfVar Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ConfVar -> m ConfVar Source #
Show ConfVar # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods showsPrec :: Int -> ConfVar -> ShowS Source # show :: ConfVar -> String Source # showList :: [ConfVar] -> ShowS Source #
Generic ConfVar # |
Instance details Defined in Distribution.Types.GenericPackageDescription Associated Types type Rep ConfVar :: Type -> Type Source # Methods from :: ConfVar -> Rep ConfVar x Source # to :: Rep ConfVar x -> ConfVar Source #
Binary ConfVar # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods put :: ConfVar -> Put Source # get :: Get ConfVar Source # putList :: [ConfVar] -> Put Source #
NFData ConfVar # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods rnf :: ConfVar -> () Source #
type Rep ConfVar # |
Instance details Defined in Distribution.Types.GenericPackageDescription type Rep ConfVar = D1 (MetaData "ConfVar" "Distribution.Types.GenericPackageDescription" "Cabal-2.4.0.1" False) ((C1 (MetaCons "OS" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 OS)) :+: C1 (MetaCons "Arch" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Arch))) :+: (C1 (MetaCons "Flag" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FlagName)) :+: C1 (MetaCons "Impl" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CompilerFlavor) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 VersionRange))))

data Condition c #

A boolean expression parameterized over the variable type used.

Constructors

Var c |
Lit Bool |
CNot (Condition c) |
COr (Condition c) (Condition c) |
CAnd (Condition c) (Condition c) |

Instances

Monad Condition # |
Instance details Defined in Distribution.Types.Condition Methods (>>=) :: Condition a -> (a -> Condition b) -> Condition b Source # (>>) :: Condition a -> Condition b -> Condition b Source # return :: a -> Condition a Source # fail :: String -> Condition a Source #
Functor Condition # |
Instance details Defined in Distribution.Types.Condition Methods fmap :: (a -> b) -> Condition a -> Condition b Source # (<$) :: a -> Condition b -> Condition a Source #
Applicative Condition # |
Instance details Defined in Distribution.Types.Condition Methods pure :: a -> Condition a Source # (<*>) :: Condition (a -> b) -> Condition a -> Condition b Source # liftA2 :: (a -> b -> c) -> Condition a -> Condition b -> Condition c Source # (*>) :: Condition a -> Condition b -> Condition b Source # (<*) :: Condition a -> Condition b -> Condition a Source #
Foldable Condition # |
Instance details Defined in Distribution.Types.Condition Methods fold :: Monoid m => Condition m -> m Source # foldMap :: Monoid m => (a -> m) -> Condition a -> m Source # foldr :: (a -> b -> b) -> b -> Condition a -> b Source # foldr' :: (a -> b -> b) -> b -> Condition a -> b Source # foldl :: (b -> a -> b) -> b -> Condition a -> b Source # foldl' :: (b -> a -> b) -> b -> Condition a -> b Source # foldr1 :: (a -> a -> a) -> Condition a -> a Source # foldl1 :: (a -> a -> a) -> Condition a -> a Source # toList :: Condition a -> [a] Source # null :: Condition a -> Bool Source # length :: Condition a -> Int Source # elem :: Eq a => a -> Condition a -> Bool Source # maximum :: Ord a => Condition a -> a Source # minimum :: Ord a => Condition a -> a Source # sum :: Num a => Condition a -> a Source # product :: Num a => Condition a -> a Source #
Traversable Condition # |
Instance details Defined in Distribution.Types.Condition Methods traverse :: Applicative f => (a -> f b) -> Condition a -> f (Condition b) Source # sequenceA :: Applicative f => Condition (f a) -> f (Condition a) Source # mapM :: Monad m => (a -> m b) -> Condition a -> m (Condition b) Source # sequence :: Monad m => Condition (m a) -> m (Condition a) Source #
Alternative Condition # |
Instance details Defined in Distribution.Types.Condition Methods empty :: Condition a Source # (<|>) :: Condition a -> Condition a -> Condition a Source # some :: Condition a -> Condition [a] Source # many :: Condition a -> Condition [a] Source #
MonadPlus Condition # |
Instance details Defined in Distribution.Types.Condition Methods mzero :: Condition a Source # mplus :: Condition a -> Condition a -> Condition a Source #
Eq c => Eq (Condition c) # |
Instance details Defined in Distribution.Types.Condition Methods (==) :: Condition c -> Condition c -> Bool # (/=) :: Condition c -> Condition c -> Bool #
Data c => Data (Condition c) # |
Instance details Defined in Distribution.Types.Condition Methods gfoldl :: (forall d b. Data d => c0 (d -> b) -> d -> c0 b) -> (forall g. g -> c0 g) -> Condition c -> c0 (Condition c) Source # gunfold :: (forall b r. Data b => c0 (b -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (Condition c) Source # toConstr :: Condition c -> Constr Source # dataTypeOf :: Condition c -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c0 (t d)) -> Maybe (c0 (Condition c)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c0 (t d e)) -> Maybe (c0 (Condition c)) Source # gmapT :: (forall b. Data b => b -> b) -> Condition c -> Condition c Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Condition c -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Condition c -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Condition c -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Condition c -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Condition c -> m (Condition c) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Condition c -> m (Condition c) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Condition c -> m (Condition c) Source #
Show c => Show (Condition c) # |
Instance details Defined in Distribution.Types.Condition Methods showsPrec :: Int -> Condition c -> ShowS Source # show :: Condition c -> String Source # showList :: [Condition c] -> ShowS Source #
Generic (Condition c) # |
Instance details Defined in Distribution.Types.Condition Associated Types type Rep (Condition c) :: Type -> Type Source # Methods from :: Condition c -> Rep (Condition c) x Source # to :: Rep (Condition c) x -> Condition c Source #
Semigroup (Condition a) # |
Instance details Defined in Distribution.Types.Condition Methods (<>) :: Condition a -> Condition a -> Condition a Source # sconcat :: NonEmpty (Condition a) -> Condition a Source # stimes :: Integral b => b -> Condition a -> Condition a Source #
Monoid (Condition a) # |
Instance details Defined in Distribution.Types.Condition Methods mempty :: Condition a Source # mappend :: Condition a -> Condition a -> Condition a Source # mconcat :: [Condition a] -> Condition a Source #
Binary c => Binary (Condition c) # |
Instance details Defined in Distribution.Types.Condition Methods put :: Condition c -> Put Source # get :: Get (Condition c) Source # putList :: [Condition c] -> Put Source #
NFData c => NFData (Condition c) # |
Instance details Defined in Distribution.Types.Condition Methods rnf :: Condition c -> () Source #
type Rep (Condition c) # |
Instance details Defined in Distribution.Types.Condition type Rep (Condition c) = D1 (MetaData "Condition" "Distribution.Types.Condition" "Cabal-2.4.0.1" False) ((C1 (MetaCons "Var" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 c)) :+: C1 (MetaCons "Lit" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))) :+: (C1 (MetaCons "CNot" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Condition c))) :+: (C1 (MetaCons "COr" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Condition c)) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Condition c))) :+: C1 (MetaCons "CAnd" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Condition c)) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Condition c))))))

cNot :: Condition a -> Condition a #

Boolean negation of a `Condition` value.

cAnd :: Condition a -> Condition a -> Condition a #

Boolean AND of two `Condtion` values.

cOr :: Eq v => Condition v -> Condition v -> Condition v #

Boolean OR of two `Condition` values.

# Source repositories

data SourceRepo #

Information about the source revision control system for a package.

When specifying a repo it is useful to know the meaning or intention of the information as doing so enables automation. There are two obvious common purposes: one is to find the repo for the latest development version, the other is to find the repo for this specific release. The `ReopKind` specifies which one we mean (or another custom one).

A package can specify one or the other kind or both. Most will specify just a head repo but some may want to specify a repo to reconstruct the sources for this package release.

The required information is the `RepoType` which tells us if it's using `Darcs`, `Git` for example. The `repoLocation` and other details are interpreted according to the repo type.

Constructors

SourceRepo |
Fields repoKind :: RepoKind The kind of repo. This field is required. repoType :: Maybe RepoType The type of the source repository system for this repo, eg `Darcs` or `Git`. This field is required. repoLocation :: Maybe String The location of the repository. For most `RepoType`s this is a URL. This field is required. repoModule :: Maybe String `CVS` can put multiple "modules" on one server and requires a module name in addition to the location to identify a particular repo. Logically this is part of the location but unfortunately has to be specified separately. This field is required for the `CVS` `RepoType` and should not be given otherwise. repoBranch :: Maybe String The name or identifier of the branch, if any. Many source control systems have the notion of multiple branches in a repo that exist in the same location. For example `Git` and `CVS` use this while systems like `Darcs` use different locations for different branches. This field is optional but should be used if necessary to identify the sources, especially for the `RepoThis` repo kind. repoTag :: Maybe String The tag identify a particular state of the repository. This should be given for the `RepoThis` repo kind and not for `RepoHead` kind. repoSubdir :: Maybe FilePath Some repositories contain multiple projects in different subdirectories This field specifies the subdirectory where this packages sources can be found, eg the subdirectory containing the `.cabal` file. It is interpreted relative to the root of the repository. This field is optional. If not given the default is "." ie no subdirectory.

Instances

Eq SourceRepo # |
Instance details Defined in Distribution.Types.SourceRepo Methods (==) :: SourceRepo -> SourceRepo -> Bool # (/=) :: SourceRepo -> SourceRepo -> Bool #
Data SourceRepo # |
Instance details Defined in Distribution.Types.SourceRepo Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceRepo -> c SourceRepo Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourceRepo Source # toConstr :: SourceRepo -> Constr Source # dataTypeOf :: SourceRepo -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourceRepo) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourceRepo) Source # gmapT :: (forall b. Data b => b -> b) -> SourceRepo -> SourceRepo Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceRepo -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceRepo -> r Source # gmapQ :: (forall d. Data d => d -> u) -> SourceRepo -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceRepo -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceRepo -> m SourceRepo Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceRepo -> m SourceRepo Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceRepo -> m SourceRepo Source #
Ord SourceRepo # |
Instance details Defined in Distribution.Types.SourceRepo Methods compare :: SourceRepo -> SourceRepo -> Ordering # (<) :: SourceRepo -> SourceRepo -> Bool # (<=) :: SourceRepo -> SourceRepo -> Bool # (>) :: SourceRepo -> SourceRepo -> Bool # (>=) :: SourceRepo -> SourceRepo -> Bool # max :: SourceRepo -> SourceRepo -> SourceRepo # min :: SourceRepo -> SourceRepo -> SourceRepo #
Read SourceRepo # |
Instance details Defined in Distribution.Types.SourceRepo Methods readsPrec :: Int -> ReadS SourceRepo Source # readList :: ReadS [SourceRepo] Source # readPrec :: ReadPrec SourceRepo Source # readListPrec :: ReadPrec [SourceRepo] Source #
Show SourceRepo # |
Instance details Defined in Distribution.Types.SourceRepo Methods showsPrec :: Int -> SourceRepo -> ShowS Source # show :: SourceRepo -> String Source # showList :: [SourceRepo] -> ShowS Source #
Generic SourceRepo # |
Instance details Defined in Distribution.Types.SourceRepo Associated Types type Rep SourceRepo :: Type -> Type Source # Methods from :: SourceRepo -> Rep SourceRepo x Source # to :: Rep SourceRepo x -> SourceRepo Source #
Binary SourceRepo # |
Instance details Defined in Distribution.Types.SourceRepo Methods put :: SourceRepo -> Put Source # get :: Get SourceRepo Source # putList :: [SourceRepo] -> Put Source #
NFData SourceRepo # |
Instance details Defined in Distribution.Types.SourceRepo Methods rnf :: SourceRepo -> () Source #
type Rep SourceRepo # |
Instance details Defined in Distribution.Types.SourceRepo type Rep SourceRepo = D1 (MetaData "SourceRepo" "Distribution.Types.SourceRepo" "Cabal-2.4.0.1" False) (C1 (MetaCons "SourceRepo" PrefixI True) ((S1 (MetaSel (Just "repoKind") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 RepoKind) :*: (S1 (MetaSel (Just "repoType") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe RepoType)) :*: S1 (MetaSel (Just "repoLocation") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String)))) :*: ((S1 (MetaSel (Just "repoModule") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String)) :*: S1 (MetaSel (Just "repoBranch") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))) :*: (S1 (MetaSel (Just "repoTag") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String)) :*: S1 (MetaSel (Just "repoSubdir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe FilePath))))))

data RepoKind #

What this repo info is for, what it represents.

Constructors

RepoHead | The repository for the "head" or development version of the project. This repo is where we should track the latest development activity or the usual repo people should get to contribute patches.
RepoThis | The repository containing the sources for this exact package version or release. For this kind of repo a tag should be given to give enough information to re-create the exact sources.
RepoKindUnknown String |

Instances

Eq RepoKind # |
Instance details Defined in Distribution.Types.SourceRepo Methods (==) :: RepoKind -> RepoKind -> Bool # (/=) :: RepoKind -> RepoKind -> Bool #
Data RepoKind # |
Instance details Defined in Distribution.Types.SourceRepo Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RepoKind -> c RepoKind Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RepoKind Source # toConstr :: RepoKind -> Constr Source # dataTypeOf :: RepoKind -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RepoKind) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RepoKind) Source # gmapT :: (forall b. Data b => b -> b) -> RepoKind -> RepoKind Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RepoKind -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RepoKind -> r Source # gmapQ :: (forall d. Data d => d -> u) -> RepoKind -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> RepoKind -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RepoKind -> m RepoKind Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RepoKind -> m RepoKind Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RepoKind -> m RepoKind Source #
Ord RepoKind # |
Instance details Defined in Distribution.Types.SourceRepo Methods compare :: RepoKind -> RepoKind -> Ordering # (<) :: RepoKind -> RepoKind -> Bool # (<=) :: RepoKind -> RepoKind -> Bool # (>) :: RepoKind -> RepoKind -> Bool # (>=) :: RepoKind -> RepoKind -> Bool # max :: RepoKind -> RepoKind -> RepoKind # min :: RepoKind -> RepoKind -> RepoKind #
Read RepoKind # |
Instance details Defined in Distribution.Types.SourceRepo Methods readsPrec :: Int -> ReadS RepoKind Source # readList :: ReadS [RepoKind] Source # readPrec :: ReadPrec RepoKind Source # readListPrec :: ReadPrec [RepoKind] Source #
Show RepoKind # |
Instance details Defined in Distribution.Types.SourceRepo Methods showsPrec :: Int -> RepoKind -> ShowS Source # show :: RepoKind -> String Source # showList :: [RepoKind] -> ShowS Source #
Generic RepoKind # |
Instance details Defined in Distribution.Types.SourceRepo Associated Types type Rep RepoKind :: Type -> Type Source # Methods from :: RepoKind -> Rep RepoKind x Source # to :: Rep RepoKind x -> RepoKind Source #
Binary RepoKind # |
Instance details Defined in Distribution.Types.SourceRepo Methods put :: RepoKind -> Put Source # get :: Get RepoKind Source # putList :: [RepoKind] -> Put Source #
NFData RepoKind # |
Instance details Defined in Distribution.Types.SourceRepo Methods rnf :: RepoKind -> () Source #
Pretty RepoKind # |
Instance details Defined in Distribution.Types.SourceRepo Methods pretty :: RepoKind -> Doc #
Parsec RepoKind # |
Instance details Defined in Distribution.Types.SourceRepo Methods parsec :: CabalParsing m => m RepoKind #
Text RepoKind # |
Instance details Defined in Distribution.Types.SourceRepo Methods disp :: RepoKind -> Doc # parse :: ReadP r RepoKind #
type Rep RepoKind # |
Instance details Defined in Distribution.Types.SourceRepo type Rep RepoKind = D1 (MetaData "RepoKind" "Distribution.Types.SourceRepo" "Cabal-2.4.0.1" False) (C1 (MetaCons "RepoHead" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "RepoThis" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "RepoKindUnknown" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))))

data RepoType #

An enumeration of common source control systems. The fields used in the `SourceRepo` depend on the type of repo. The tools and methods used to obtain and track the repo depend on the repo type.

Constructors

Darcs |
Git |
SVN |
CVS |
Mercurial |
GnuArch |
Bazaar |
Monotone |
OtherRepoType String |

Instances

Eq RepoType # |
Instance details Defined in Distribution.Types.SourceRepo Methods (==) :: RepoType -> RepoType -> Bool # (/=) :: RepoType -> RepoType -> Bool #
Data RepoType # |
Instance details Defined in Distribution.Types.SourceRepo Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RepoType -> c RepoType Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RepoType Source # toConstr :: RepoType -> Constr Source # dataTypeOf :: RepoType -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RepoType) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RepoType) Source # gmapT :: (forall b. Data b => b -> b) -> RepoType -> RepoType Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RepoType -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RepoType -> r Source # gmapQ :: (forall d. Data d => d -> u) -> RepoType -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> RepoType -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RepoType -> m RepoType Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RepoType -> m RepoType Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RepoType -> m RepoType Source #
Ord RepoType # |
Instance details Defined in Distribution.Types.SourceRepo Methods compare :: RepoType -> RepoType -> Ordering # (<) :: RepoType -> RepoType -> Bool # (<=) :: RepoType -> RepoType -> Bool # (>) :: RepoType -> RepoType -> Bool # (>=) :: RepoType -> RepoType -> Bool # max :: RepoType -> RepoType -> RepoType # min :: RepoType -> RepoType -> RepoType #
Read RepoType # |
Instance details Defined in Distribution.Types.SourceRepo Methods readsPrec :: Int -> ReadS RepoType Source # readList :: ReadS [RepoType] Source # readPrec :: ReadPrec RepoType Source # readListPrec :: ReadPrec [RepoType] Source #
Show RepoType # |
Instance details Defined in Distribution.Types.SourceRepo Methods showsPrec :: Int -> RepoType -> ShowS Source # show :: RepoType -> String Source # showList :: [RepoType] -> ShowS Source #
Generic RepoType # |
Instance details Defined in Distribution.Types.SourceRepo Associated Types type Rep RepoType :: Type -> Type Source # Methods from :: RepoType -> Rep RepoType x Source # to :: Rep RepoType x -> RepoType Source #
Binary RepoType # |
Instance details Defined in Distribution.Types.SourceRepo Methods put :: RepoType -> Put Source # get :: Get RepoType Source # putList :: [RepoType] -> Put Source #
NFData RepoType # |
Instance details Defined in Distribution.Types.SourceRepo Methods rnf :: RepoType -> () Source #
Pretty RepoType # |
Instance details Defined in Distribution.Types.SourceRepo Methods pretty :: RepoType -> Doc #
Parsec RepoType # |
Instance details Defined in Distribution.Types.SourceRepo Methods parsec :: CabalParsing m => m RepoType #
Text RepoType # |
Instance details Defined in Distribution.Types.SourceRepo Methods disp :: RepoType -> Doc # parse :: ReadP r RepoType #
type Rep RepoType # |
Instance details Defined in Distribution.Types.SourceRepo type Rep RepoType = D1 (MetaData "RepoType" "Distribution.Types.SourceRepo" "Cabal-2.4.0.1" False) (((C1 (MetaCons "Darcs" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Git" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "SVN" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "CVS" PrefixI False) (U1 :: Type -> Type))) :+: ((C1 (MetaCons "Mercurial" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "GnuArch" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "Bazaar" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Monotone" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "OtherRepoType" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))))))

knownRepoTypes :: [RepoType] #

emptySourceRepo :: RepoKind -> SourceRepo #

# Custom setup build information

data SetupBuildInfo #

Constructors

SetupBuildInfo |
Fields setupDepends :: [Dependency] defaultSetupDepends :: Bool Is this a default 'custom-setup' section added by the cabal-install code (as opposed to user-provided)? This field is only used internally, and doesn't correspond to anything in the .cabal file. See #3199.

Instances

Eq SetupBuildInfo # |
Instance details Defined in Distribution.Types.SetupBuildInfo Methods (==) :: SetupBuildInfo -> SetupBuildInfo -> Bool # (/=) :: SetupBuildInfo -> SetupBuildInfo -> Bool #
Data SetupBuildInfo # |
Instance details Defined in Distribution.Types.SetupBuildInfo Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SetupBuildInfo -> c SetupBuildInfo Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SetupBuildInfo Source # toConstr :: SetupBuildInfo -> Constr Source # dataTypeOf :: SetupBuildInfo -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SetupBuildInfo) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SetupBuildInfo) Source # gmapT :: (forall b. Data b => b -> b) -> SetupBuildInfo -> SetupBuildInfo Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SetupBuildInfo -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SetupBuildInfo -> r Source # gmapQ :: (forall d. Data d => d -> u) -> SetupBuildInfo -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> SetupBuildInfo -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SetupBuildInfo -> m SetupBuildInfo Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SetupBuildInfo -> m SetupBuildInfo Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SetupBuildInfo -> m SetupBuildInfo Source #
Read SetupBuildInfo # |
Instance details Defined in Distribution.Types.SetupBuildInfo Methods readsPrec :: Int -> ReadS SetupBuildInfo Source # readList :: ReadS [SetupBuildInfo] Source # readPrec :: ReadPrec SetupBuildInfo Source # readListPrec :: ReadPrec [SetupBuildInfo] Source #
Show SetupBuildInfo # |
Instance details Defined in Distribution.Types.SetupBuildInfo Methods showsPrec :: Int -> SetupBuildInfo -> ShowS Source # show :: SetupBuildInfo -> String Source # showList :: [SetupBuildInfo] -> ShowS Source #
Generic SetupBuildInfo # |
Instance details Defined in Distribution.Types.SetupBuildInfo Associated Types type Rep SetupBuildInfo :: Type -> Type Source # Methods from :: SetupBuildInfo -> Rep SetupBuildInfo x Source # to :: Rep SetupBuildInfo x -> SetupBuildInfo Source #
Semigroup SetupBuildInfo # |
Instance details Defined in Distribution.Types.SetupBuildInfo Methods (<>) :: SetupBuildInfo -> SetupBuildInfo -> SetupBuildInfo Source # sconcat :: NonEmpty SetupBuildInfo -> SetupBuildInfo Source # stimes :: Integral b => b -> SetupBuildInfo -> SetupBuildInfo Source #
Monoid SetupBuildInfo # |
Instance details Defined in Distribution.Types.SetupBuildInfo Methods mempty :: SetupBuildInfo Source # mappend :: SetupBuildInfo -> SetupBuildInfo -> SetupBuildInfo Source # mconcat :: [SetupBuildInfo] -> SetupBuildInfo Source #
Binary SetupBuildInfo # |
Instance details Defined in Distribution.Types.SetupBuildInfo Methods put :: SetupBuildInfo -> Put Source # get :: Get SetupBuildInfo Source # putList :: [SetupBuildInfo] -> Put Source #
NFData SetupBuildInfo # |
Instance details Defined in Distribution.Types.SetupBuildInfo Methods rnf :: SetupBuildInfo -> () Source #
type Rep SetupBuildInfo # |
Instance details Defined in Distribution.Types.SetupBuildInfo type Rep SetupBuildInfo = D1 (MetaData "SetupBuildInfo" "Distribution.Types.SetupBuildInfo" "Cabal-2.4.0.1" False) (C1 (MetaCons "SetupBuildInfo" PrefixI True) (S1 (MetaSel (Just "setupDepends") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Dependency]) :*: S1 (MetaSel (Just "defaultSetupDepends") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))