ModuleCabal-3.16.0.0Haskell2010
Distribution.Make
This is an alternative build system that delegates everything to the make
program. All the commands just end up calling make with appropriate
arguments. The intention was to allow preexisting packages that used
makefiles to be wrapped into Cabal packages. In practice essentially all
such packages were converted over to the "Simple" build system instead.
Consequently this module is not used much and it certainly only sees cursory
maintenance and no testing. Perhaps at some point we should stop pretending
that it works.
Uses the parsed command-line from Distribution.Simple.Setup in order to build Haskell tools using a back-end build system based on make. Obviously we assume that there is a configure script, and that after the ConfigCmd has been run, there is a Makefile. Further assumptions:
- ConfigCmd
We assume the configure script accepts
--with-hc,
--with-hc-pkg,
--prefix,
--bindir,
--libdir,
--libexecdir,
--datadir.
- BuildCmd
We assume that the default Makefile target will build everything.
- InstallCmd
We assume there is an
installtarget. Note that we assume that this does *not* register the package!
- CopyCmd
We assume there is a
copytarget, and a variable
$(destdir). The
copytarget should probably just invoke
make installrecursively (e.g.
$(MAKE) install prefix=$(destdir)/$(prefix) bindir=$(destdir)/$(bindir). The reason we can't invoke
make installdirectly here is that we don't know the value of
$(prefix).
- SDistCmd
We assume there is a
disttarget.
- RegisterCmd
We assume there is a
registertarget and a variable
$(user).
- UnregisterCmd
We assume there is an
unregistertarget.
- HaddockCmd
We assume there is a
docsor
doctarget.
- 12 types
- 4 classes
- 29 values
- PackageCabal-3.16.0.0
- Exports45
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceMake.hs
Construct a ComponentId from a String
mkComponentId is the inverse to unComponentId
Note: No validations are performed to ensure that the resulting ComponentId is valid
Convert ComponentId to String
Library set with main library.
Smart constructor of Dependency.
If PackageName is appears as LSubLibName in a set of sublibraries, it is automatically converted to LMainLibName.
Simplify the VersionRange expression in a Dependency. See simplifyVersionRange.
Construct a PackageName from a String
mkPackageName is the inverse to unPackageName
Note: No validations are performed to ensure that the resulting PackageName is valid
Construct a PackageName from a ShortText
Note: No validations are performed to ensure that the resulting PackageName is valid
Convert PackageName to String
Construct a PkgconfigName from a String
mkPkgconfigName is the inverse to unPkgconfigName
Note: No validations are performed to ensure that the resulting PkgconfigName is valid
Convert PkgconfigName to String
Returns library name prefixed with HS, suitable for filenames
Make an old-style UnitId from a package identifier. Assumed to be for the public library
Create a unit identity with no associated hash directly from a ComponentId.
If you need backwards compatibility, consider using display
instead, which is supported by all versions of Cabal.
Methods
mungedId :: pkg -> MungedPackageId
Instances3HasMungedPackageId
HasMungedPackageId PreExistingComponentDefined in Cabal-3.16.0.0 · Distribution.Backpack.PreExistingComponentHasMungedPackageId InstalledPackageInfoDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.InstalledPackageInfoHasMungedPackageId MungedPackageIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Package
Packages that have an installed unit ID
Methods
installedUnitId :: pkg -> UnitId
Instances3HasUnitId
HasUnitId PreExistingComponentDefined in Cabal-3.16.0.0 · Distribution.Backpack.PreExistingComponentHasUnitId ReadyComponentDefined in Cabal-3.16.0.0 · Distribution.Backpack.ReadyComponentHasUnitId InstalledPackageInfoDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.InstalledPackageInfo
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 -> PackageIdentifier
Instances9Package, …
Package LinkedComponentDefined in Cabal-3.16.0.0 · Distribution.Backpack.LinkedComponentPackage ConfiguredPromisedComponentDefined in Cabal-3.16.0.0 · Distribution.Backpack.PreExistingComponentPackage PreExistingComponentDefined in Cabal-3.16.0.0 · Distribution.Backpack.PreExistingComponentPackage ReadyComponentDefined in Cabal-3.16.0.0 · Distribution.Backpack.ReadyComponentPackage GenericPackageDescriptionDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.GenericPackageDescriptionPackage InstalledPackageInfoDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.InstalledPackageInfoPackage PackageDescriptionDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageDescriptionPackage PackageIdentifierDefined in Cabal-syntax-3.16.0.0 · Distribution.PackagePackage (AnnotatedId id)Defined in Cabal-3.16.0.0 · Distribution.Types.AnnotatedId
Class of installed packages.
The primary data type which is an instance of this package is
InstalledPackageInfo, but when we are doing install plans in Cabal install
we may have other, installed package-like things which contain more metadata.
Installed packages have exact dependencies installedDepends.
Methods
installedDepends :: pkg -> [UnitId]
Instances1PackageInstalled
PackageInstalled InstalledPackageInfoDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.InstalledPackageInfo
Instances11Eq, Read, Show, IsString, Generic, NFData, …
Eq AbiHashDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.AbiHashRead AbiHashDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.AbiHashShow AbiHashDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.AbiHashIsString AbiHashDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.AbiHashGeneric AbiHashDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.AbiHashNFData AbiHashDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.AbiHashBinary AbiHashDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.AbiHashParsec AbiHashDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.AbiHashPretty AbiHashDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.AbiHashStructured AbiHashDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.AbiHashtype Rep AbiHash = D1 ('MetaDataDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.AbiHash"AbiHash"
"Distribution.Types.AbiHash"
"Cabal-syntax-3.16.0.0-c954"
'True) (C1 ('MetaCons"AbiHash"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortText)))
A ComponentId uniquely identifies the transitive source code closure of a component (i.e. libraries, executables).
For non-Backpack components, this corresponds one to one with
the UnitId, which serves as the basis for install paths,
linker symbols, etc.
Use mkComponentId and unComponentId to convert from/to a String.
This type is opaque since Cabal-2.0
Instances13Eq, Data, Ord, Read, Show, IsString, …
Eq ComponentIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ComponentIdData ComponentIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ComponentIdOrd ComponentIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ComponentIdRead ComponentIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ComponentIdShow ComponentIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ComponentIdIsString ComponentIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ComponentIdGeneric ComponentIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ComponentIdNFData ComponentIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ComponentIdBinary ComponentIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ComponentIdParsec ComponentIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ComponentIdPretty ComponentIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ComponentIdStructured ComponentIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ComponentIdtype Rep ComponentId = D1 ('MetaDataDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ComponentId"ComponentId"
"Distribution.Types.ComponentId"
"Cabal-syntax-3.16.0.0-c954"
'True) (C1 ('MetaCons"ComponentId"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortText)))
Describes a dependency on a source package (API)
Invariant: package name does not appear as LSubLibName in set of library names.
Constructors
Dependency PackageName VersionRange (NonEmptySet LibraryName)The set of libraries required from the package. Only the selected libraries will be built. It does not affect the cabal-install solver yet.
Instances12Eq, Data, Ord, Read, Show, Generic, …
Eq DependencyDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.DependencyData DependencyDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.DependencyOrd DependencyDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.DependencyRead DependencyDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.DependencyShow DependencyDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.DependencyGeneric DependencyDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.DependencyNFData DependencyDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.DependencyBinary DependencyDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.DependencyParsec DependencyDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.DependencyExample1 expression simpleParsec "mylib:sub" :: Maybe DependencyJust (Dependency (PackageName "mylib") (OrLaterVersion (mkVersion [0])) (fromNonEmpty (LSubLibName (UnqualComponentName "sub") :| [])))
Example1 expression simpleParsec "mylib:{sub1,sub2}" :: Maybe DependencyJust (Dependency (PackageName "mylib") (OrLaterVersion (mkVersion [0])) (fromNonEmpty (LSubLibName (UnqualComponentName "sub1") :| [LSubLibName (UnqualComponentName "sub2")])))
Example1 expression simpleParsec "mylib:{ sub1 , sub2 }" :: Maybe DependencyJust (Dependency (PackageName "mylib") (OrLaterVersion (mkVersion [0])) (fromNonEmpty (LSubLibName (UnqualComponentName "sub1") :| [LSubLibName (UnqualComponentName "sub2")])))
Example1 expression simpleParsec "mylib:{ sub1 , sub2 } ^>= 42" :: Maybe DependencyJust (Dependency (PackageName "mylib") (MajorBoundVersion (mkVersion [42])) (fromNonEmpty (LSubLibName (UnqualComponentName "sub1") :| [LSubLibName (UnqualComponentName "sub2")])))
Example1 expression simpleParsec "mylib:{ } ^>= 42" :: Maybe DependencyNothing
Example1 expression traverse_ print (map simpleParsec ["mylib:mylib", "mylib:{mylib}", "mylib:{mylib,sublib}" ] :: [Maybe Dependency])Just (Dependency (PackageName "mylib") (OrLaterVersion (mkVersion [0])) (fromNonEmpty (LMainLibName :| [])))Just (Dependency (PackageName "mylib") (OrLaterVersion (mkVersion [0])) (fromNonEmpty (LMainLibName :| [])))Just (Dependency (PackageName "mylib") (OrLaterVersion (mkVersion [0])) (fromNonEmpty (LMainLibName :| [LSubLibName (UnqualComponentName "sublib")])))
Spaces around colon are not allowed:
Example1 expression map simpleParsec ["mylib: sub", "mylib :sub", "mylib: {sub1,sub2}", "mylib :{sub1,sub2}"] :: [Maybe Dependency][Nothing,Nothing,Nothing,Nothing]
Sublibrary syntax is accepted since
cabal-version: 3.0Example1 expression map (`simpleParsec'` "mylib:sub") [CabalSpecV2_4, CabalSpecV3_0] :: [Maybe Dependency][Nothing,Just (Dependency (PackageName "mylib") (OrLaterVersion (mkVersion [0])) (fromNonEmpty (LSubLibName (UnqualComponentName "sub") :| [])))]
Pretty DependencyDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.DependencyExample1 expression prettyShow $ Dependency (mkPackageName "pkg") anyVersion mainLibSet"pkg"
Example1 expression prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.insert (LSubLibName $ mkUnqualComponentName "sublib") mainLibSet"pkg:{pkg,sublib}"
Example1 expression prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.singleton (LSubLibName $ mkUnqualComponentName "sublib")"pkg:sublib"
Example1 expression prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.insert (LSubLibName $ mkUnqualComponentName "sublib-b") $ NES.singleton (LSubLibName $ mkUnqualComponentName "sublib-a")"pkg:{sublib-a,sublib-b}"
Structured DependencyDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.Dependencytype Rep Dependency = D1 ('MetaDataDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.Dependency"Dependency"
"Distribution.Types.Dependency"
"Cabal-syntax-3.16.0.0-c954"
'False) (C1 ('MetaCons"Dependency"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VersionRange) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmptySet LibraryName)))))
A module identity uniquely identifies a Haskell module by
qualifying a ModuleName with the UnitId which defined
it. This type distinguishes between two packages
which provide a module with the same name, or a module
from the same package compiled with different dependencies.
There are a few cases where Cabal needs to know about
module identities, e.g., when writing out reexported modules in
the InstalledPackageInfo.
Constructors
Instances12Eq, Data, Ord, Read, Show, Generic, …
Eq ModuleDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ModuleData ModuleDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ModuleOrd ModuleDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ModuleRead ModuleDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ModuleShow ModuleDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ModuleGeneric ModuleDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ModuleNFData ModuleDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ModuleBinary ModuleDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ModuleParsec ModuleDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ModulePretty ModuleDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.ModuleStructured ModuleDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.Moduletype Rep Module = D1 ('MetaDataDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.Module"Module"
"Distribution.Types.Module"
"Cabal-syntax-3.16.0.0-c954"
'False) (C1 ('MetaCons"Module"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DefUnitId) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModuleName)))
Type alias so we can use the shorter name PackageId.
The name and version of a package.
Constructors
PackageIdentifierpkgName :: PackageNameThe name of this package, eg. foo
pkgVersion :: Versionthe version of this package, eg 1.2
Instances13Eq, Data, Ord, Read, Show, Generic, …
Eq PackageIdentifierDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageIdData PackageIdentifierDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageIdOrd PackageIdentifierDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageIdRead PackageIdentifierDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageIdShow PackageIdentifierDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageIdGeneric PackageIdentifierDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageIdNFData PackageIdentifierDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageIdBinary PackageIdentifierDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageIdParsec PackageIdentifierDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageIdExample1 expression simpleParsec "foo-bar-0" :: Maybe PackageIdentifierJust (PackageIdentifier {pkgName = PackageName "foo-bar", pkgVersion = mkVersion [0]})
Example1 expression simpleParsec "foo-bar" :: Maybe PackageIdentifierJust (PackageIdentifier {pkgName = PackageName "foo-bar", pkgVersion = mkVersion []})
Note: Stricter than
TextinstanceExample1 expression simpleParsec "foo-bar-0-0" :: Maybe PackageIdentifierNothing
Example1 expression simpleParsec "foo-bar.0" :: Maybe PackageIdentifierNothing
Example1 expression simpleParsec "foo-bar.4-2" :: Maybe PackageIdentifierNothing
Example1 expression simpleParsec "1.2.3" :: Maybe PackageIdentifierNothing
Pretty PackageIdentifierDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageIdStructured PackageIdentifierDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageIdPackage PackageIdentifierDefined in Cabal-syntax-3.16.0.0 · Distribution.Packagetype Rep PackageIdentifier = D1 ('MetaDataDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageId"PackageIdentifier"
"Distribution.Types.PackageId"
"Cabal-syntax-3.16.0.0-c954"
'False) (C1 ('MetaCons"PackageIdentifier"
'PrefixI 'True) (S1 ('MetaSel ('Just"pkgName"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: S1 ('MetaSel ('Just"pkgVersion"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)))
A package name.
Use mkPackageName and unPackageName to convert from/to a String.
This type is opaque since Cabal-2.0
Instances13Eq, Data, Ord, Read, Show, IsString, …
Eq PackageNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageNameData PackageNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageNameOrd PackageNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageNameRead PackageNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageNameShow PackageNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageNameIsString PackageNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageNameGeneric PackageNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageNameNFData PackageNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageNameBinary PackageNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageNameParsec PackageNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageNamePretty PackageNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageNameStructured PackageNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageNametype Rep PackageName = D1 ('MetaDataDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PackageName"PackageName"
"Distribution.Types.PackageName"
"Cabal-syntax-3.16.0.0-c954"
'True) (C1 ('MetaCons"PackageName"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortText)))
A pkg-config library name
This is parsed as any valid argument to the pkg-config utility.
Instances13Eq, Data, Ord, Read, Show, IsString, …
Eq PkgconfigNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PkgconfigNameData PkgconfigNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PkgconfigNameOrd PkgconfigNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PkgconfigNameRead PkgconfigNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PkgconfigNameShow PkgconfigNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PkgconfigNameIsString PkgconfigNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PkgconfigNameGeneric PkgconfigNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PkgconfigNameNFData PkgconfigNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PkgconfigNameBinary PkgconfigNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PkgconfigNameParsec PkgconfigNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PkgconfigNamePretty PkgconfigNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PkgconfigNameStructured PkgconfigNameDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PkgconfigNametype Rep PkgconfigName = D1 ('MetaDataDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.PkgconfigName"PkgconfigName"
"Distribution.Types.PkgconfigName"
"Cabal-syntax-3.16.0.0-c954"
'True) (C1 ('MetaCons"PkgconfigName"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortText)))
Instances12Eq, Data, Ord, Read, Show, Generic, …
Eq DefUnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdData DefUnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdOrd DefUnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdRead DefUnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdShow DefUnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdGeneric DefUnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdNFData DefUnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdBinary DefUnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdParsec DefUnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdPretty DefUnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdStructured DefUnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdtype Rep DefUnitId = D1 ('MetaDataDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitId"DefUnitId"
"Distribution.Types.UnitId"
"Cabal-syntax-3.16.0.0-c954"
'True) (C1 ('MetaCons"DefUnitId"
'PrefixI 'True) (S1 ('MetaSel ('Just"unDefUnitId"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UnitId)))
A unit identifier identifies a (possibly instantiated) package/component that can be installed the installed package database. There are several types of components that can be installed:
A traditional library with no holes, so that
unitIdHashisNothing. In the absence of Backpack, UnitId is the same as a ComponentId.An indefinite, Backpack library with holes. In this case,
unitIdHashis stillNothing, but in the install, there are only interfaces, no compiled objects.An instantiated Backpack library with all the holes filled in.
unitIdHashis aJusta hash of the instantiating mapping.
A unit is a component plus the additional information on how the holes are filled in. Thus there is a one to many relationship: for a particular component there are many different ways of filling in the holes, and each different combination is a unit (and has a separate UnitId).
UnitId is distinct from OpenUnitId, in that it is always
installed, whereas OpenUnitId are intermediate unit identities
that arise during mixin linking, and don't necessarily correspond
to any actually installed unit. Since the mapping is not actually
recorded in a UnitId, you can't actually substitute over them
(but you can substitute over OpenUnitId). See also
Distribution.Backpack.FullUnitId for a mechanism for expanding an
instantiated UnitId to retrieve its mapping.
Backwards compatibility note: if you need to get the string
representation of a UnitId to pass, e.g., as a -package-id
flag, use the display function, which will work on all
versions of Cabal.
Instances13Eq, Data, Ord, Read, Show, IsString, …
Eq UnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdData UnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdOrd UnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdRead UnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdShow UnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdIsString UnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdGeneric UnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdNFData UnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdBinary UnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdParsec UnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdThe textual format for UnitId coincides with the format GHC accepts for
-package-id.Pretty UnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdThe textual format for UnitId coincides with the format GHC accepts for
-package-id.Structured UnitIdDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitIdtype Rep UnitId = D1 ('MetaDataDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.UnitId"UnitId"
"Distribution.Types.UnitId"
"Cabal-syntax-3.16.0.0-c954"
'True) (C1 ('MetaCons"UnitId"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortText)))
Indicates the license under which a package's source code is released.
Versions of the licenses not listed here will be rejected by Hackage and
cause cabal check to issue a warning.
Constructors
GPL (Maybe Version)AGPL (Maybe Version)LGPL (Maybe Version)GNU Lesser General Public License, version 2.1 or version 3.
BSD2BSD3BSD44-clause BSD license. This license has not been approved by the OSI and is incompatible with the GNU GPL. It is provided for historical reasons and should be avoided.
MITISCMPL VersionApache (Maybe Version)PublicDomainThe author of a package disclaims any copyright to its source code and dedicates it to the public domain. This is not a software license. Please note that it is not possible to dedicate works to the public domain in every jurisdiction, nor is a work that is in the public domain in one jurisdiction necessarily in the public domain elsewhere.
AllRightsReservedExplicitly 'All Rights Reserved', eg for proprietary software. The package may not be legally modified or redistributed by anyone but the rightsholder.
UnspecifiedLicenseNo license specified which legally defaults to 'All Rights Reserved'. The package may not be legally modified or redistributed by anyone but the rightsholder.
OtherLicenseAny other software license.
UnknownLicense StringIndicates an erroneous license name.
Instances14Eq, Data, Ord, Read, Show, Generic, …
Eq LicenseDefined in Cabal-syntax-3.16.0.0 · Distribution.LicenseData LicenseDefined in Cabal-syntax-3.16.0.0 · Distribution.LicenseOrd LicenseDefined in Cabal-syntax-3.16.0.0 · Distribution.LicenseRead LicenseDefined in Cabal-syntax-3.16.0.0 · Distribution.LicenseShow LicenseDefined in Cabal-syntax-3.16.0.0 · Distribution.LicenseGeneric LicenseDefined in Cabal-syntax-3.16.0.0 · Distribution.LicenseNFData LicenseDefined in Cabal-syntax-3.16.0.0 · Distribution.LicenseBinary LicenseDefined in Cabal-syntax-3.16.0.0 · Distribution.LicenseParsec LicenseDefined in Cabal-syntax-3.16.0.0 · Distribution.LicensePretty LicenseDefined in Cabal-syntax-3.16.0.0 · Distribution.LicenseStructured LicenseDefined in Cabal-syntax-3.16.0.0 · Distribution.LicenseNewtype (Either License License) SpecLicenseDefined in Cabal-syntax-3.16.0.0 · Distribution.FieldGrammar.NewtypesNewtype (Either License License) SpecLicenseLenientDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.InstalledPackageInfo.FieldGrammartype Rep License = D1 ('MetaDataDefined in Cabal-syntax-3.16.0.0 · Distribution.License"License"
"Distribution.License"
"Cabal-syntax-3.16.0.0-c954"
'False) (((C1 ('MetaCons"GPL"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Version))) :+: (C1 ('MetaCons"AGPL"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Version))) :+: C1 ('MetaCons"LGPL"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Version))))) :+: ((C1 ('MetaCons"BSD2"
'PrefixI 'False) U1 :+: C1 ('MetaCons"BSD3"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"BSD4"
'PrefixI 'False) U1 :+: C1 ('MetaCons"MIT"
'PrefixI 'False) U1))) :+: (((C1 ('MetaCons"ISC"
'PrefixI 'False) U1 :+: C1 ('MetaCons"MPL"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version))) :+: (C1 ('MetaCons"Apache"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Version))) :+: C1 ('MetaCons"PublicDomain"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"AllRightsReserved"
'PrefixI 'False) U1 :+: C1 ('MetaCons"UnspecifiedLicense"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"OtherLicense"
'PrefixI 'False) U1 :+: C1 ('MetaCons"UnknownLicense"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))))
A Version represents the version of a software entity.
Instances of Eq and Ord are provided, which gives exact equality and lexicographic ordering of the version number components (i.e. 2.1 > 2.0, 1.2.3 > 1.2.2, etc.).
This type is opaque and distinct from the Version type in
Data.Version since Cabal-2.0. The difference extends to the
Binary instance using a different (and more compact) encoding.
Instances12Eq, Data, Ord, Read, Show, Generic, …
Eq VersionDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.VersionData VersionDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.VersionOrd VersionDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.VersionRead VersionDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.VersionShow VersionDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.VersionGeneric VersionDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.VersionNFData VersionDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.VersionBinary VersionDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.VersionParsec VersionDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.VersionPretty VersionDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.VersionStructured VersionDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.Versiontype Rep Version = D1 ('MetaDataDefined in Cabal-syntax-3.16.0.0 · Distribution.Types.Version"Version"
"Distribution.Types.Version"
"Cabal-syntax-3.16.0.0-c954"
'False) (C1 ('MetaCons"PV0"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'SourceUnpack 'SourceStrict 'DecidedUnpack) (Rec0 Word64)) :+: C1 ('MetaCons"PV1"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Int])))