Cabal-1.8.0.6: A framework for packaging Haskell softwareSource codeContentsIndex
Distribution.Package
Portabilityportable
Maintainercabal-devel@haskell.org
Contents
Package ids
Installed package identifiers
Package source dependencies
Package classes
Description
Defines a package identifier along with a parser and pretty printer for it. PackageIdentifiers consist of a name and an exact version. It also defines a Dependency data type. A dependency is a package name and a version range, like "foo >= 1.2 && < 2".
Synopsis
newtype PackageName = PackageName String
data PackageIdentifier = PackageIdentifier {
pkgName :: PackageName
pkgVersion :: Version
}
type PackageId = PackageIdentifier
newtype InstalledPackageId = InstalledPackageId String
data Dependency = Dependency PackageName VersionRange
thisPackageVersion :: PackageIdentifier -> Dependency
notThisPackageVersion :: PackageIdentifier -> Dependency
simplifyDependency :: Dependency -> Dependency
class Package pkg where
packageId :: pkg -> PackageIdentifier
packageName :: Package pkg => pkg -> PackageName
packageVersion :: Package pkg => pkg -> Version
class Package pkg => PackageFixedDeps pkg where
depends :: pkg -> [PackageIdentifier]
Package ids
newtype PackageName Source
Constructors
PackageName String
show/hide Instances
data PackageIdentifier Source
The name and version of a package.
Constructors
PackageIdentifier
pkgName :: PackageNameThe name of this package, eg. foo
pkgVersion :: Versionthe version of this package, eg 1.2
show/hide Instances
type PackageId = PackageIdentifierSource
Type alias so we can use the shorter name PackageId.
Installed package identifiers
newtype InstalledPackageId Source
An InstalledPackageId uniquely identifies an instance of an installed package. There can be at most one package with a given InstalledPackageId in a package database, or overlay of databases.
Constructors
InstalledPackageId String
show/hide Instances
Package source dependencies
data Dependency Source
Describes a dependency on a source package (API)
Constructors
Dependency PackageName VersionRange
show/hide Instances
thisPackageVersion :: PackageIdentifier -> DependencySource
notThisPackageVersion :: PackageIdentifier -> DependencySource
simplifyDependency :: Dependency -> DependencySource
Simplify the VersionRange expression in a Dependency. See simplifyVersionRange.
Package classes
class Package pkg whereSource

Class of things that have a PackageIdentifier

Types in this class are all notions of a package. This allows us to have different types for the different phases that packages go though, from simple name/id, package description, configured or installed packages.

Not all kinds of packages can be uniquely identified by a PackageIdentifier. In particular, installed packages cannot, there may be many installed instances of the same source package.

Methods
packageId :: pkg -> PackageIdentifierSource
show/hide Instances
packageName :: Package pkg => pkg -> PackageNameSource
packageVersion :: Package pkg => pkg -> VersionSource
class Package pkg => PackageFixedDeps pkg whereSource

Subclass of packages that have specific versioned dependencies.

So for example a not-yet-configured package has dependencies on version ranges, not specific versions. A configured or an already installed package depends on exact versions. Some operations or data structures (like dependency graphs) only make sense on this subclass of package types.

Methods
depends :: pkg -> [PackageIdentifier]Source
Produced by Haddock version 2.6.1