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


-- | Cabal file wrapper library
--   
--   Find and read .cabal files, and a Cabal dependency compatibility
--   layer.
@package simple-cabal
@version 0.1.1

module SimpleCabal

-- | Find the .cabal file in the current directory.
--   
--   Errors if more than one or no file found.
--   
--   since <tt>0.0.0.1</tt>
findCabalFile :: IO FilePath

-- | Generate PackageDescription from the specified .cabal file and flags.
--   
--   since <tt>0.0.0.1</tt>
finalPackageDescription :: [(FlagName, Bool)] -> FilePath -> IO PackageDescription

-- | Get the package name-version from the .cabal file in the current
--   directory.
--   
--   since <tt>0.0.0.1</tt>
getPackageId :: IO PackageIdentifier

-- | Return the list of build dependencies of a package, excluding itself
buildDependencies :: PackageDescription -> [PackageName]
setupDependencies :: PackageDescription -> [PackageName]

-- | Return the list of testsuite dependencies of a package, excluding
--   itself
testsuiteDependencies :: PackageDescription -> [PackageName]

-- | All <a>BuildInfo</a> in the <a>PackageDescription</a>: libraries,
--   executables, test-suites and benchmarks.
--   
--   Useful for implementing package checks.
allBuildInfo :: PackageDescription -> [BuildInfo]
data BuildInfo
BuildInfo :: Bool -> [LegacyExeDependency] -> [ExeDependency] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [PkgconfigDependency] -> [String] -> [String] -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> [ModuleName] -> [ModuleName] -> [ModuleName] -> Maybe Language -> [Language] -> [Extension] -> [Extension] -> [Extension] -> [String] -> [String] -> [String] -> [String] -> [String] -> [FilePath] -> [FilePath] -> [FilePath] -> [(CompilerFlavor, [String])] -> [(CompilerFlavor, [String])] -> [(CompilerFlavor, [String])] -> [(CompilerFlavor, [String])] -> [(String, String)] -> [Dependency] -> [Mixin] -> BuildInfo

-- | component is buildable here
[buildable] :: BuildInfo -> Bool

-- | Tools needed to build this bit.
--   
--   This is a legacy field that <a>buildToolDepends</a> larely supersedes.
--   
--   Unless use are very sure what you are doing, use the functions in
--   <a>Distribution.Simple.BuildToolDepends</a> rather than accessing this
--   field directly.
[buildTools] :: BuildInfo -> [LegacyExeDependency]

-- | Haskell tools needed to build this bit
--   
--   This field is better than <a>buildTools</a> 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
--   <a>Distribution.Simple.BuildToolDepends</a> rather than accessing this
--   field directly.
[buildToolDepends] :: BuildInfo -> [ExeDependency]

-- | options for pre-processing Haskell code
[cppOptions] :: BuildInfo -> [String]

-- | options for assmebler
[asmOptions] :: BuildInfo -> [String]

-- | options for C-- compiler
[cmmOptions] :: BuildInfo -> [String]

-- | options for C compiler
[ccOptions] :: BuildInfo -> [String]

-- | options for C++ compiler
[cxxOptions] :: BuildInfo -> [String]

-- | options for linker
[ldOptions] :: BuildInfo -> [String]

-- | pkg-config packages that are used
[pkgconfigDepends] :: BuildInfo -> [PkgconfigDependency]

-- | support frameworks for Mac OS X
[frameworks] :: BuildInfo -> [String]

-- | extra locations to find frameworks.
[extraFrameworkDirs] :: BuildInfo -> [String]

-- | Assembly files.
[asmSources] :: BuildInfo -> [FilePath]

-- | C-- files.
[cmmSources] :: BuildInfo -> [FilePath]
[cSources] :: BuildInfo -> [FilePath]
[cxxSources] :: BuildInfo -> [FilePath]
[jsSources] :: BuildInfo -> [FilePath]

-- | where to look for the Haskell module hierarchy
[hsSourceDirs] :: BuildInfo -> [FilePath]

-- | non-exposed or non-main modules
[otherModules] :: BuildInfo -> [ModuleName]

-- | exposed modules that do not have a source file (e.g. <tt>GHC.Prim</tt>
--   from <tt>ghc-prim</tt> package)
[virtualModules] :: BuildInfo -> [ModuleName]

-- | not present on sdist, Paths_* or user-generated with a custom Setup.hs
[autogenModules] :: BuildInfo -> [ModuleName]

-- | language used when not explicitly specified
[defaultLanguage] :: BuildInfo -> Maybe Language

-- | other languages used within the package
[otherLanguages] :: BuildInfo -> [Language]

-- | language extensions used by all modules
[defaultExtensions] :: BuildInfo -> [Extension]

-- | other language extensions used within the package
[otherExtensions] :: BuildInfo -> [Extension]

-- | the old extensions field, treated same as <a>defaultExtensions</a>
[oldExtensions] :: BuildInfo -> [Extension]

-- | what libraries to link with when compiling a program that uses your
--   package
[extraLibs] :: BuildInfo -> [String]

-- | if present, overrides extraLibs when package is loaded with GHCi.
[extraGHCiLibs] :: BuildInfo -> [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.
[extraBundledLibs] :: BuildInfo -> [String]

-- | Hidden Flag. This set of strings, will be appended to all lirbaries
--   when copying. E.g. [libHS<a>name</a>_<a>flavour</a> | flavour &lt;-
--   extraLibFlavours]. This should only be needed in very specific cases,
--   e.g. the <tt>rts</tt> package, where there are multiple copies of
--   slightly differently built libs.
[extraLibFlavours] :: BuildInfo -> [String]
[extraLibDirs] :: BuildInfo -> [String]

-- | directories to find .h files
[includeDirs] :: BuildInfo -> [FilePath]

-- | The .h files to be found in includeDirs
[includes] :: BuildInfo -> [FilePath]

-- | .h files to install with the package
[installIncludes] :: BuildInfo -> [FilePath]
[options] :: BuildInfo -> [(CompilerFlavor, [String])]
[profOptions] :: BuildInfo -> [(CompilerFlavor, [String])]
[sharedOptions] :: BuildInfo -> [(CompilerFlavor, [String])]
[staticOptions] :: BuildInfo -> [(CompilerFlavor, [String])]

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

-- | Dependencies specific to a library or executable target
[targetBuildDepends] :: BuildInfo -> [Dependency]
[mixins] :: BuildInfo -> [Mixin]
depPkgName :: Dependency -> PackageName
exeDepName :: LegacyExeDependency -> String
pkgcfgDepName :: PkgconfigDependency -> String

-- | A <a>FlagName</a> is the name of a user-defined configuration flag
--   
--   Use <a>mkFlagName</a> and <a>unFlagName</a> to convert from/to a
--   <a>String</a>.
--   
--   This type is opaque since <tt>Cabal-2.0</tt>
data FlagName

-- | Construct a <a>FlagName</a> from a <a>String</a>
--   
--   <a>mkFlagName</a> is the inverse to <a>unFlagName</a>
--   
--   Note: No validations are performed to ensure that the resulting
--   <a>FlagName</a> is valid
mkFlagName :: String -> FlagName

-- | 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 :: Either Version VersionRange -> PackageIdentifier -> Either License License -> [FilePath] -> String -> String -> String -> String -> [(CompilerFlavor, VersionRange)] -> String -> String -> String -> [SourceRepo] -> String -> String -> String -> [(String, String)] -> [Dependency] -> Maybe BuildType -> Maybe SetupBuildInfo -> Maybe Library -> [Library] -> [Executable] -> [ForeignLib] -> [TestSuite] -> [Benchmark] -> [FilePath] -> FilePath -> [FilePath] -> [FilePath] -> [FilePath] -> PackageDescription

-- | 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. See
--   also <a>specVersion</a>.
[specVersionRaw] :: PackageDescription -> Either Version VersionRange
[package] :: PackageDescription -> PackageIdentifier
[licenseRaw] :: PackageDescription -> Either License 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 original <tt>build-type</tt> value as parsed from the
--   <tt>.cabal</tt> file without defaulting. See also <a>buildType</a>.
[buildTypeRaw] :: 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 package name.
--   
--   Use <a>mkPackageName</a> and <a>unPackageName</a> to convert from/to a
--   <a>String</a>.
--   
--   This type is opaque since <tt>Cabal-2.0</tt>
data PackageName

-- | Construct a <a>PackageName</a> from a <a>String</a>
--   
--   <a>mkPackageName</a> is the inverse to <a>unPackageName</a>
--   
--   Note: No validations are performed to ensure that the resulting
--   <a>PackageName</a> is valid
mkPackageName :: String -> PackageName

-- | Convert <a>PackageName</a> to <a>String</a>
unPackageName :: PackageName -> String
packageName :: Package pkg => pkg -> PackageName
packageVersion :: PackageIdentifier -> String

-- | Parse the given package file.
readGenericPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription
showPkgId :: PackageIdentifier -> String
showVersion :: Version -> String
tryFindPackageDesc :: FilePath -> IO FilePath
