Safe Haskell | None |
---|
This module contains queries that operate on a PackageDescription. It provides a function to extract all targets along with their dependencies.
- data Target = Target {
- info :: TargetInfo
- dependencies :: [(String, Maybe Version)]
- sourceDirs :: [FilePath]
- includeDirs :: [FilePath]
- ghcOptions :: [String]
- cppOptions :: [String]
- extensions :: [String]
- buildable :: Bool
- otherModules :: [String]
- enabled :: Bool
- data TargetInfo
- data PackageDescription
- targets :: Query PackageDescription [Target]
- targetName :: Target -> String
- isLibrary :: Target -> Bool
- isExecutable :: Target -> Bool
- isTest :: Target -> Bool
- isBench :: Target -> Bool
Documentation
A target is a single Library, an Executable, a TestSuite or a Benchmark.
Target | |
|
data TargetInfo Source
The specific information on a target, depending on the target type. Libraries don't have a name, they are always named after the package, but other types do
Library [String] | contains the names of exposed modules |
Executable String FilePath | contains the name of the executable and the path to the Main module |
TestSuite String (Maybe FilePath) | contains the name of the test suite and the path to the Main module, for stdio tests |
BenchSuite String | contains the name of the benchmark |
data PackageDescription Source
A package description type. This type has no constructors, and is only used for type-safety purposes.
targets :: Query PackageDescription [Target]Source
Query the available targets. This will return all targets, even disabled ones. If a package is disabled or not buildable, it's possible that not all dependencies have versions, some can be Nothing.
targetName :: Target -> StringSource
return the target name, or the empty string for the library target
isExecutable :: Target -> BoolSource
is the target an executable?