| Cabal-1.6.0.3: A framework for packaging Haskell software | Source code | Contents | Index
Distribution.Package |
Portability | portable
Maintainer | cabal-devel@haskell.org
Contents
Package ids Package dependencies Package classes
Description
Defines a package identifier along with a parser and pretty printer for it. `PackageIdentifier`s 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
data Dependency = Dependency PackageName VersionRange
thisPackageVersion :: PackageIdentifier -> Dependency
notThisPackageVersion :: PackageIdentifier -> 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 |
Instances
Eq PackageName
Ord PackageName
Read PackageName
Show PackageName
Text PackageName
data PackageIdentifier | Source
The name and version of a package.
Constructors
PackageIdentifier |
pkgName :: PackageName | The name of this package, eg. foo
pkgVersion :: Version | the version of this package, eg 1.2
Instances
Eq PackageIdentifier
Ord PackageIdentifier
Read PackageIdentifier
Show PackageIdentifier
Text PackageIdentifier
Package PackageIdentifier
type PackageId = PackageIdentifier | Source
Type alias so we can use the shorter name PackageId.
Package dependencies
data Dependency | Source
Constructors
Dependency PackageName VersionRange |
Instances
Eq Dependency
Read Dependency
Show Dependency
Text Dependency
thisPackageVersion :: PackageIdentifier -> Dependency | Source
notThisPackageVersion :: PackageIdentifier -> Dependency | Source
Package classes
class Package pkg where | Source
Class of things that can be identified by 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.
Methods
packageId :: pkg -> PackageIdentifier | Source
Instances
Package PackageIdentifier
Package GenericPackageDescription
Package PackageDescription
Package (InstalledPackageInfo_ str)
packageName :: Package pkg => pkg -> PackageName | Source
packageVersion :: Package pkg => pkg -> Version | Source
class Package pkg => PackageFixedDeps pkg where | Source
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
Instances
PackageFixedDeps (InstalledPackageInfo_ str)
Produced by Haddock version 2.4.2