-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Template Haskell expressions for reading fields from a project's cabal file.
--   
--   Template Haskell expressions for reading fields from a project's cabal
--   file.
@package cabal-file-th
@version 0.2.4


-- | Utility functions for reading cabal file fields through template
--   haskell.
module Distribution.PackageDescription.TH

-- | Renders the package variable specified by the function. The cabal file
--   interrogated is the first one that is found in the current working
--   directory.
packageVariable :: Text a => (PackageDescription -> a) -> Q Exp

-- | Renders the package variable specified by the function, from a cabal
--   file and the given path.
packageVariableFrom :: Text a => FilePath -> (PackageDescription -> a) -> Q Exp

-- | Provides a Text instance for String, allowing text fields to be used
--   in <a>packageVariable</a>. Use it composed with an accessor, eg.
--   packageVariable (packageString . copyright)
packageString :: String -> DocString

-- | This data type is the internal representation of the file
--   <tt>pkg.cabal</tt>. 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.
data PackageDescription :: *
PackageDescription :: PackageIdentifier -> License -> [FilePath] -> String -> String -> String -> String -> [(CompilerFlavor, VersionRange)] -> String -> String -> String -> [SourceRepo] -> String -> String -> String -> [(String, String)] -> [Dependency] -> Either Version VersionRange -> Maybe BuildType -> Maybe SetupBuildInfo -> Maybe Library -> [Library] -> [Executable] -> [ForeignLib] -> [TestSuite] -> [Benchmark] -> [FilePath] -> FilePath -> [FilePath] -> [FilePath] -> [FilePath] -> PackageDescription
[package] :: PackageDescription -> PackageIdentifier
[license] :: PackageDescription -> License
[licenseFiles] :: PackageDescription -> [FilePath]
[copyright] :: PackageDescription -> String
[maintainer] :: PackageDescription -> String
[author] :: PackageDescription -> String
[stability] :: PackageDescription -> String
[testedWith] :: PackageDescription -> [(CompilerFlavor, VersionRange)]
[homepage] :: PackageDescription -> String
[pkgUrl] :: PackageDescription -> String
[bugReports] :: PackageDescription -> String
[sourceRepos] :: PackageDescription -> [SourceRepo]

-- | A one-line summary of this package
[synopsis] :: PackageDescription -> String

-- | A more verbose description of this package
[description] :: PackageDescription -> String
[category] :: PackageDescription -> String

-- | Custom fields starting with x-, stored in a simple assoc-list.
[customFieldsPD] :: PackageDescription -> [(String, String)]

-- | YOU PROBABLY DON'T WANT TO USE THIS FIELD. This field is special!
--   Depending on how far along processing the PackageDescription we are,
--   the contents of this field are either nonsense, or the collected
--   dependencies of *all* the components in this package. buildDepends is
--   initialized by <tt>finalizePD</tt> and
--   <tt>flattenPackageDescription</tt>; prior to that, dependency info is
--   stored in the <tt>CondTree</tt> built around a
--   <tt>GenericPackageDescription</tt>. When this resolution is done,
--   dependency info is written to the inner <a>BuildInfo</a> and this
--   field. This is all horrible, and #2066 tracks progress to get rid of
--   this field.
[buildDepends] :: PackageDescription -> [Dependency]

-- | 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 <tt>&gt;= v</tt> make sense. We are in the process
--   of transitioning to specifying just a single version, not a range.
[specVersionRaw] :: PackageDescription -> Either Version VersionRange
[buildType] :: PackageDescription -> Maybe BuildType
[setupBuildInfo] :: PackageDescription -> Maybe SetupBuildInfo
[library] :: PackageDescription -> Maybe Library
[subLibraries] :: PackageDescription -> [Library]
[executables] :: PackageDescription -> [Executable]
[foreignLibs] :: PackageDescription -> [ForeignLib]
[testSuites] :: PackageDescription -> [TestSuite]
[benchmarks] :: PackageDescription -> [Benchmark]
[dataFiles] :: PackageDescription -> [FilePath]
[dataDir] :: PackageDescription -> FilePath
[extraSrcFiles] :: PackageDescription -> [FilePath]
[extraTmpFiles] :: PackageDescription -> [FilePath]
[extraDocFiles] :: PackageDescription -> [FilePath]

-- | The name and version of a package.
data PackageIdentifier :: *
PackageIdentifier :: PackageName -> Version -> PackageIdentifier

-- | The name of this package, eg. foo
[pkgName] :: PackageIdentifier -> PackageName

-- | the version of this package, eg 1.2
[pkgVersion] :: PackageIdentifier -> Version

-- | A <a>Version</a> represents the version of a software entity.
--   
--   Instances of <a>Eq</a> and <a>Ord</a> are provided, which gives exact
--   equality and lexicographic ordering of the version number components
--   (i.e. 2.1 &gt; 2.0, 1.2.3 &gt; 1.2.2, etc.).
--   
--   This type is opaque and distinct from the <a>Version</a> type in
--   <a>Data.Version</a> since <tt>Cabal-2.0</tt>. The difference extends
--   to the <a>Binary</a> instance using a different (and more compact)
--   encoding.
data Version :: *
instance Distribution.Text.Text Distribution.PackageDescription.TH.DocString
