ModuleCabal-3.18.1.0Haskell2010
Distribution.Simple
This is the command line front end to the Simple build system. When given the parsed command-line args and package information, is able to perform basic commands like configure, build, install, register, etc.
This module exports the main functions that Setup.hs scripts use. It
re-exports the UserHooks type, the standard entry points like
defaultMain and defaultMainWithHooks and the predefined sets of
UserHooks that custom Setup.hs scripts can extend to add their own
behaviour.
This module isn't called "Simple" because it's simple. Far from it. It's called "Simple" because it does complicated things to simple software.
The original idea was that there could be different build systems that all presented the same compatible command line interfaces.
- 24 types
- 4 classes
- 110 values
- PackageCabal-3.18.1.0
- Exports141
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceSimple.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.18.1.0 · Distribution.Backpack.PreExistingComponentHasMungedPackageId InstalledPackageInfoDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.InstalledPackageInfoHasMungedPackageId MungedPackageIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Package
Packages that have an installed unit ID
Methods
installedUnitId :: pkg -> UnitId
Instances3HasUnitId
HasUnitId PreExistingComponentDefined in Cabal-3.18.1.0 · Distribution.Backpack.PreExistingComponentHasUnitId ReadyComponentDefined in Cabal-3.18.1.0 · Distribution.Backpack.ReadyComponentHasUnitId InstalledPackageInfoDefined in Cabal-syntax-3.18.1.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.18.1.0 · Distribution.Backpack.LinkedComponentPackage ConfiguredPromisedComponentDefined in Cabal-3.18.1.0 · Distribution.Backpack.PreExistingComponentPackage PreExistingComponentDefined in Cabal-3.18.1.0 · Distribution.Backpack.PreExistingComponentPackage ReadyComponentDefined in Cabal-3.18.1.0 · Distribution.Backpack.ReadyComponentPackage GenericPackageDescriptionDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.GenericPackageDescriptionPackage InstalledPackageInfoDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.InstalledPackageInfoPackage PackageDescriptionDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageDescriptionPackage PackageIdentifierDefined in Cabal-syntax-3.18.1.0 · Distribution.PackagePackage (AnnotatedId id)Defined in Cabal-3.18.1.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.18.1.0 · Distribution.Types.InstalledPackageInfo
Instances11Eq, Read, Show, IsString, Generic, NFData, …
Eq AbiHashDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.AbiHashRead AbiHashDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.AbiHashShow AbiHashDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.AbiHashIsString AbiHashDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.AbiHashGeneric AbiHashDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.AbiHashNFData AbiHashDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.AbiHashBinary AbiHashDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.AbiHashParsec AbiHashDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.AbiHashPretty AbiHashDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.AbiHashStructured AbiHashDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.AbiHashtype Rep AbiHash = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.AbiHash"AbiHash"
"Distribution.Types.AbiHash"
"Cabal-syntax-3.18.1.0-a008"
'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.18.1.0 · Distribution.Types.ComponentIdData ComponentIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ComponentIdOrd ComponentIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ComponentIdRead ComponentIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ComponentIdShow ComponentIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ComponentIdIsString ComponentIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ComponentIdGeneric ComponentIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ComponentIdNFData ComponentIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ComponentIdBinary ComponentIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ComponentIdParsec ComponentIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ComponentIdPretty ComponentIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ComponentIdStructured ComponentIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ComponentIdtype Rep ComponentId = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ComponentId"ComponentId"
"Distribution.Types.ComponentId"
"Cabal-syntax-3.18.1.0-a008"
'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.18.1.0 · Distribution.Types.DependencyData DependencyDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.DependencyOrd DependencyDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.DependencyRead DependencyDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.DependencyShow DependencyDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.DependencyGeneric DependencyDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.DependencyNFData DependencyDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.DependencyBinary DependencyDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.DependencyParsec DependencyDefined in Cabal-syntax-3.18.1.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.18.1.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.18.1.0 · Distribution.Types.Dependencytype Rep Dependency = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.Dependency"Dependency"
"Distribution.Types.Dependency"
"Cabal-syntax-3.18.1.0-a008"
'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.18.1.0 · Distribution.Types.ModuleData ModuleDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ModuleOrd ModuleDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ModuleRead ModuleDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ModuleShow ModuleDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ModuleGeneric ModuleDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ModuleNFData ModuleDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ModuleBinary ModuleDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ModuleParsec ModuleDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ModulePretty ModuleDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.ModuleStructured ModuleDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.Moduletype Rep Module = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.Module"Module"
"Distribution.Types.Module"
"Cabal-syntax-3.18.1.0-a008"
'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.18.1.0 · Distribution.Types.PackageIdData PackageIdentifierDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageIdOrd PackageIdentifierDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageIdRead PackageIdentifierDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageIdShow PackageIdentifierDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageIdGeneric PackageIdentifierDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageIdNFData PackageIdentifierDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageIdBinary PackageIdentifierDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageIdParsec PackageIdentifierDefined in Cabal-syntax-3.18.1.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.18.1.0 · Distribution.Types.PackageIdStructured PackageIdentifierDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageIdPackage PackageIdentifierDefined in Cabal-syntax-3.18.1.0 · Distribution.Packagetype Rep PackageIdentifier = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageId"PackageIdentifier"
"Distribution.Types.PackageId"
"Cabal-syntax-3.18.1.0-a008"
'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.18.1.0 · Distribution.Types.PackageNameData PackageNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageNameOrd PackageNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageNameRead PackageNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageNameShow PackageNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageNameIsString PackageNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageNameGeneric PackageNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageNameNFData PackageNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageNameBinary PackageNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageNameParsec PackageNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageNamePretty PackageNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageNameStructured PackageNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageNametype Rep PackageName = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PackageName"PackageName"
"Distribution.Types.PackageName"
"Cabal-syntax-3.18.1.0-a008"
'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.18.1.0 · Distribution.Types.PkgconfigNameData PkgconfigNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PkgconfigNameOrd PkgconfigNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PkgconfigNameRead PkgconfigNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PkgconfigNameShow PkgconfigNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PkgconfigNameIsString PkgconfigNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PkgconfigNameGeneric PkgconfigNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PkgconfigNameNFData PkgconfigNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PkgconfigNameBinary PkgconfigNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PkgconfigNameParsec PkgconfigNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PkgconfigNamePretty PkgconfigNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PkgconfigNameStructured PkgconfigNameDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PkgconfigNametype Rep PkgconfigName = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.PkgconfigName"PkgconfigName"
"Distribution.Types.PkgconfigName"
"Cabal-syntax-3.18.1.0-a008"
'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.18.1.0 · Distribution.Types.UnitIdData DefUnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdOrd DefUnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdRead DefUnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdShow DefUnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdGeneric DefUnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdNFData DefUnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdBinary DefUnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdParsec DefUnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdPretty DefUnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdStructured DefUnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdtype Rep DefUnitId = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitId"DefUnitId"
"Distribution.Types.UnitId"
"Cabal-syntax-3.18.1.0-a008"
'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.18.1.0 · Distribution.Types.UnitIdData UnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdOrd UnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdRead UnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdShow UnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdIsString UnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdGeneric UnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdNFData UnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdBinary UnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdParsec UnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdThe textual format for UnitId coincides with the format GHC accepts for
-package-id.Pretty UnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdThe textual format for UnitId coincides with the format GHC accepts for
-package-id.Structured UnitIdDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitIdtype Rep UnitId = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.UnitId"UnitId"
"Distribution.Types.UnitId"
"Cabal-syntax-3.18.1.0-a008"
'True) (C1 ('MetaCons"UnitId"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortText)))
Apply function to list of version number components
alterVersion f == mkVersion . f . versionNumbersConstruct Version from list of version number components.
For instance, mkVersion [3,2,1] constructs a Version
representing the version 3.2.1.
All version components must be non-negative. mkVersion []
currently represents the special null version; see also nullVersion.
Variant of mkVersion which converts a Data.Version Version into Cabal's Version type.
Constant representing the special null Version
The nullVersion compares (via Ord) as less than every proper Version value.
Version 0. A lower bound of Version.
View a VersionRange as a union of intervals.
This provides a canonical view of the semantics of a VersionRange as
opposed to the syntax of the expression used to define it. For the syntactic
view use foldVersionRange.
Each interval is non-empty. The sequence is in increasing order and no
intervals overlap or touch. Therefore only the first and last can be
unbounded. The sequence can be empty if the range is empty
(e.g. a range expression like < 1 && > 2).
Other checks are trivial to implement using this view. For example:
isNoVersion vr | [] <- asVersionIntervals vr = True
| otherwise = FalseisSpecificVersion vr
| [(LowerBound v InclusiveBound
,UpperBound v' InclusiveBound)] <- asVersionIntervals vr
, v == v' = Just v
| otherwise = NothingConvert a VersionIntervals value back into a VersionRange expression representing the version intervals.
Convert a VersionRange to a sequence of version intervals.
Inspect the list of version intervals.
foldVersionRange :: a"-any"version-> (Version -> a)"== v"-> (Version -> a)"> v"-> (Version -> a)"< v"-> (a -> a -> a)"_ || _"union-> (a -> a -> a)"_ && _"intersection-> VersionRange-> a
Fold over the basic syntactic structure of a VersionRange.
This provides a syntactic view of the expression defining the version range.
The syntactic sugar ">= v", "<= v" and "== v.*" is presented
in terms of the other basic syntax.
For a semantic view use asVersionIntervals.
Is the lower bound version range greater than (GT, >)?
forM ["< 1", ">= 0 && < 1", ">= 0 || < 1", "> 0 && < 1", "> 0 || < 1", "^>= 4.20.0.0"] (fmap hasGTLowerBound . simpleParsec)Just [False,False,False,True,True,False]
Is the upper bound version range (less than or equal (LE, <=)?
forM ["< 1", "<= 1", ">= 0 && < 1", ">= 0 || < 1", ">= 0 && <= 1", ">= 0 || <= 1", "^>= 4.20.0.0"] (fmap hasLEUpperBound . simpleParsec)Just [False,True,False,False,True,True,False]
Does the version range have an explicit lower bound?
Note: this function only considers the user-specified lower bounds, but not the implicit >=0 lower bound.
forM ["< 1", ">= 0 && < 1", ">= 0 || < 1", "^>= 4.20.0.0"] (fmap hasLowerBound . simpleParsec)Just [False,True,False,True]
Does the upper bound version range have a trailing zero?
forM ["< 1", "< 1.1", "< 1.0", "< 1.1.0", "^>= 4.20.0.0"] (fmap hasTrailingZeroUpperBound . simpleParsec)Just [False,False,True,True,False]
Does the version range have an upper bound?
forM ["< 1", ">= 0 && < 1", ">= 0 || < 1", "^>= 4.20.0.0"] (fmap hasUpperBound . simpleParsec)Just [True,True,False,True]
Does this VersionRange place any restriction on the Version or is it
in fact equivalent to AnyVersion.
Note this is a semantic check, not simply a syntactic check. So for example
the following is True (for all v).
isAnyVersion (EarlierVersion v `UnionVersionRanges` orLaterVersion v)Normalise VersionRange.
In particular collapse (== v || > v) into >= v, and so on.
Remove VersionRangeParens constructors.
Since version 3.4 this function is id, there aren't VersionRangeParens constructor in VersionRange anymore.
Does this version fall within the given range?
This is the evaluation function for the VersionRange type.
Unfold VersionRange.
The version range -any. That is, a version range containing all
versions.
withinRange v anyVersion = TrueFold VersionRange.
The version range < v.
withinRange v' (earlierVersion v) = v' < vGeneric constructor for VersionRange.
Refold VersionRange.
The version range vr1 && vr2.
withinRange v' (intersectVersionRanges vr1 vr2)
= withinRange v' vr1 && withinRange v' vr2The version range > v.
withinRange v' (laterVersion v) = v' > vThe version range ^>= v.
For example, for version 1.2.3.4, the version range ^>= 1.2.3.4
is the same as >= 1.2.3.4 && < 1.3.
Note that ^>= 1 is equivalent to >= 1 && < 1.1.
Compute next greater major version to be used as upper bound.
Example: 0.4.1 produces the version 0.5 which then can be used
to construct a range >= 0.4.1 && < 0.5
The empty version range -none, that is a version range containing no versions.
This can be constructed using any unsatisfiable version range expression,
for example < 0.
withinRange v noVersion = FalseThe version range /= v.
withinRange v' (notThisVersion v) = v' /= vThe version range <= v.
withinRange v' (orEarlierVersion v) = v' <= vThe version range >= v.
withinRange v' (orLaterVersion v) = v' >= vGeneric destructor for VersionRange.
The version range == v.
withinRange v' (thisVersion v) = v' == vThe version range vr1 || vr2.
withinRange v' (unionVersionRanges vr1 vr2)
= withinRange v' vr1 || withinRange v' vr2Increment the last version number.
Example: For 1.2 this returns 1.3
so that it can be used as upper bound when resolving == 1.2.*.
For 0.4.1 it returns 0.4.2.
The version range == v.*.
For example, for version 1.2, the version range == 1.2.* is the same as
>= 1.2 && < 1.3.
withinRange v' (withinVersion v) = v' >= v && v' < upper v
where
upper (Version lower t) = Version (init lower ++ [last lower + 1]) tThis is the converse of isAnyVersion. It check if the version range is empty, if there is no possible version that satisfies the version range.
For example this is True (for all v):
isNoVersion (EarlierVersion v `IntersectVersionRanges` LaterVersion v)Is this version range in fact just a specific version?
For example the version range ">= 3 && <= 3" contains only the version
3.
Given a version range, remove the lowest lower bound.
Example: (>= 1 && < 3) || (>= 4 && < 5) is converted to
(>= 0 && < 3) || (>= 4 && < 5).
Given a version range, remove the highest upper bound. Example: (>= 1 && <
3) || (>= 4 && < 5) is converted to (>= 1 && < 3) || (>= 4).
Simplify a VersionRange expression. For non-empty version ranges this produces a canonical form. Empty or inconsistent version ranges are left as-is because that provides more information.
If you need a canonical form use
fromVersionIntervals . toVersionIntervals
It satisfies the following properties:
withinRange v (simplifyVersionRange r) = withinRange v r withinRange v r = withinRange v r'
==> simplifyVersionRange r = simplifyVersionRange r'
|| isNoVersion r
|| isNoVersion r'Rewrite ^>= x.y.z into >= x.y.z && < x.(y+1) with explicit lower bound
and upper bound. It has the same effect as:
\v -> transformCaretLower v `intersectVersionRanges` transformCaretUpper vmapVR transformCaret ["^>=1.2.3.4", "^>=1.2.3", "^>=1.2", "^>=1"][>=1.2.3.4 && <1.3,>=1.2.3 && <1.3,>=1.2 && <1.3,>=1 && <1.1]
Rewrite ^>= x.y.z into explicit upper bound <x.(y+1), removing the
lower bound.
mapVR transformCaretLower ["^>=0.0.0.0", "^>=0.0.0", "^>=0.0", "^>=0"][<0.1,<0.1,<0.1,<0.1]
mapVR transformCaretLower ["^>=1.1.1.1", "^>=1.1.1", "^>=1.1", "^>=1"][<1.2,<1.2,<1.2,<1.1]
Rewrite ^>= x.y.z into explicit lower bound >= x.y.z, removing the
upper bound. This function doesn't transform the lower bound. It changes the
operator from ^>= to >=.
mapVR transformCaretUpper ["^>=1.2.3.4", "^>=1.2.3", "^>=1.2", "^>=1"][>=1.2.3.4,>=1.2.3,>=1.2,>=1]
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.18.1.0 · Distribution.Types.VersionData VersionDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionOrd VersionDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRead VersionDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionShow VersionDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionGeneric VersionDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionNFData VersionDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionBinary VersionDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionParsec VersionDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionPretty VersionDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionStructured VersionDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.Versiontype Rep Version = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.Version"Version"
"Distribution.Types.Version"
"Cabal-syntax-3.18.1.0-a008"
'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])))
Constructors
Instances2Eq, Show
Eq LowerBoundDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionIntervalShow LowerBoundDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionInterval
Constructors
Instances2Eq, Show
Eq UpperBoundDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionIntervalShow UpperBoundDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionInterval
Constructors
Instances2Eq, Show
Eq VersionIntervalDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionIntervalShow VersionIntervalDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionInterval
A complementary representation of a VersionRange. Instead of a boolean version predicate it uses an increasing sequence of non-overlapping, non-empty intervals.
The key point is that this representation gives a canonical representation for the semantics of VersionRanges. This makes it easier to check things like whether a version range is empty, covers all versions, or requires a certain minimum or maximum version. It also makes it easy to check equality or containment. It also makes it easier to identify 'simple' version predicates for translation into foreign packaging systems that do not support complex version range expressions.
Instances2Eq, Show
Eq VersionIntervalsDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionIntervalShow VersionIntervalsDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionInterval
Instances13Eq, Data, Ord, Read, Show, Generic, …
Eq VersionRangeDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalData VersionRangeDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalOrd VersionRangeDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalRead VersionRangeDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalShow VersionRangeDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalGeneric VersionRangeDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalNFData VersionRangeDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalBinary VersionRangeDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalParsec VersionRangeDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalExample1 expression simpleParsec "^>= 3.4" :: Maybe VersionRangeJust (MajorBoundVersion (mkVersion [3,4]))
Small history:
-anyand-noneremoved in 3.4 Use>=0and<0instead.Example1 expression map (`simpleParsec'` "-none") [CabalSpecV3_0, CabalSpecV3_4] :: [Maybe VersionRange][Just (EarlierVersion (mkVersion [0])),Nothing]
Set operations are introduced in 3.0
Example1 expression map (`simpleParsec'` "^>= { 1.2 , 1.3 }") [CabalSpecV2_4, CabalSpecV3_0] :: [Maybe VersionRange][Nothing,Just (UnionVersionRanges (MajorBoundVersion (mkVersion [1,2])) (MajorBoundVersion (mkVersion [1,3])))]
^>=is introduced in 2.0Example1 expression map (`simpleParsec'` "^>=1.2") [CabalSpecV1_24, CabalSpecV2_0] :: [Maybe VersionRange][Nothing,Just (MajorBoundVersion (mkVersion [1,2]))]
-noneis introduced in 1.22Example1 expression map (`simpleParsec'` "-none") [CabalSpecV1_20, CabalSpecV1_22] :: [Maybe VersionRange][Nothing,Just (EarlierVersion (mkVersion [0]))]
Operators are introduced in 1.8. Issues only a warning.
Example1 expression map (`simpleParsecW'` "== 1 || ==2") [CabalSpecV1_6, CabalSpecV1_8] :: [Maybe VersionRange][Nothing,Just (UnionVersionRanges (ThisVersion (mkVersion [1])) (ThisVersion (mkVersion [2])))]
Wild-version ranges are introduced in 1.6. Issues only a warning.
Example1 expression map (`simpleParsecW'` "== 1.2.*") [CabalSpecV1_4, CabalSpecV1_6] :: [Maybe VersionRange][Nothing,Just (IntersectVersionRanges (OrLaterVersion (mkVersion [1,2])) (EarlierVersion (mkVersion [1,3])))]
Pretty VersionRangeDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalExample1 expression fmap pretty (simpleParsec' CabalSpecV1_6 "== 3.2.*" :: Maybe VersionRange)Just >=3.2 && <3.3
Example1 expression fmap (prettyVersioned CabalSpecV1_6) (simpleParsec' CabalSpecV1_6 "== 3.2.*" :: Maybe VersionRange)Just ==3.2.*
Example1 expression fmap pretty (simpleParsec' CabalSpecV1_6 "-any" :: Maybe VersionRange)Just >=0
Example1 expression fmap (prettyVersioned CabalSpecV1_6) (simpleParsec' CabalSpecV1_6 "-any" :: Maybe VersionRange)Just >=0
Structured VersionRangeDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalNewtype (CompilerFlavor, VersionRange) TestedWithDefined in Cabal-syntax-3.18.1.0 · Distribution.FieldGrammar.Newtypestype Rep VersionRange = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.Internal"VersionRange"
"Distribution.Types.VersionRange.Internal"
"Cabal-syntax-3.18.1.0-a008"
'False) (((C1 ('MetaCons"ThisVersion"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)) :+: C1 ('MetaCons"LaterVersion"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version))) :+: (C1 ('MetaCons"OrLaterVersion"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)) :+: C1 ('MetaCons"EarlierVersion"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)))) :+: ((C1 ('MetaCons"OrEarlierVersion"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)) :+: C1 ('MetaCons"MajorBoundVersion"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version))) :+: (C1 ('MetaCons"UnionVersionRanges"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VersionRange) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VersionRange)) :+: C1 ('MetaCons"IntersectVersionRanges"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VersionRange) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VersionRange)))))
F-Algebra of VersionRange. See cataVersionRange.
Constructors
ThisVersionF Version== version.LaterVersionF Version> version. NB: not>=OrLaterVersionF Version>= version.EarlierVersionF Version< version.OrEarlierVersionF Version<= version.MajorBoundVersionF Version^>= version, same as>= version && < MAJ(version)+1.UnionVersionRangesF a a||.IntersectVersionRangesF a a&&.
Instances9Functor, Foldable, Traversable, Eq, Data, Read, …
Functor VersionRangeFDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalFoldable VersionRangeFDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalTraversable VersionRangeFDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalEq a => Eq (VersionRangeF a)Defined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalData a => Data (VersionRangeF a)Defined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalRead a => Read (VersionRangeF a)Defined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalShow a => Show (VersionRangeF a)Defined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.InternalGeneric (VersionRangeF a)Defined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.Internaltype Rep (VersionRangeF a) = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.VersionRange.Internal"VersionRangeF"
"Distribution.Types.VersionRange.Internal"
"Cabal-syntax-3.18.1.0-a008"
'False) (((C1 ('MetaCons"ThisVersionF"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)) :+: C1 ('MetaCons"LaterVersionF"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version))) :+: (C1 ('MetaCons"OrLaterVersionF"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)) :+: C1 ('MetaCons"EarlierVersionF"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)))) :+: ((C1 ('MetaCons"OrEarlierVersionF"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)) :+: C1 ('MetaCons"MajorBoundVersionF"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version))) :+: (C1 ('MetaCons"UnionVersionRangesF"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons"IntersectVersionRangesF"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))))
The list of all currently recognised licenses.
This is lossy conversion. We try our best.
licenseFromSPDX . licenseToSPDX $ BSD3BSD3
licenseFromSPDX . licenseToSPDX $ GPL (Just (mkVersion [3]))GPL (Just (mkVersion [3]))
licenseFromSPDX . licenseToSPDX $ PublicDomainUnknownLicense "LicenseRefPublicDomain"
licenseFromSPDX $ SPDX.License $ SPDX.simpleLicenseExpression SPDX.EUPL_1_1UnknownLicense "EUPL-1.1"
licenseFromSPDX . licenseToSPDX $ AllRightsReservedAllRightsReserved
licenseFromSPDX <$> simpleParsec "BSD-3-Clause OR GPL-3.0-only"Just (UnknownLicense "BSD3ClauseORGPL30only")
Convert old License to SPDX License. Non-SPDX licenses are converted to LicenseRef.
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.18.1.0 · Distribution.LicenseData LicenseDefined in Cabal-syntax-3.18.1.0 · Distribution.LicenseOrd LicenseDefined in Cabal-syntax-3.18.1.0 · Distribution.LicenseRead LicenseDefined in Cabal-syntax-3.18.1.0 · Distribution.LicenseShow LicenseDefined in Cabal-syntax-3.18.1.0 · Distribution.LicenseGeneric LicenseDefined in Cabal-syntax-3.18.1.0 · Distribution.LicenseNFData LicenseDefined in Cabal-syntax-3.18.1.0 · Distribution.LicenseBinary LicenseDefined in Cabal-syntax-3.18.1.0 · Distribution.LicenseParsec LicenseDefined in Cabal-syntax-3.18.1.0 · Distribution.LicensePretty LicenseDefined in Cabal-syntax-3.18.1.0 · Distribution.LicenseStructured LicenseDefined in Cabal-syntax-3.18.1.0 · Distribution.LicenseNewtype (Either License License) SpecLicenseDefined in Cabal-syntax-3.18.1.0 · Distribution.FieldGrammar.NewtypesNewtype (Either License License) SpecLicenseLenientDefined in Cabal-syntax-3.18.1.0 · Distribution.Types.InstalledPackageInfo.FieldGrammartype Rep License = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Distribution.License"License"
"Distribution.License"
"Cabal-syntax-3.18.1.0-a008"
'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))))))
module Distribution.Simple.Compiler
Extensions that have been deprecated, possibly paired with another extension that replaces it.
List of known (supported) languages for GHC, oldest first.
This represents language extensions beyond a base Language definition (such as Haskell98) that are supported by some implementations, usually in some special mode.
Where applicable, references are given to an implementation's official documentation.
Constructors
EnableExtension KnownExtensionEnable a known extension
DisableExtension KnownExtensionDisable a known extension
UnknownExtension StringAn unknown extension, identified by the name of its
LANGUAGEpragma.
Instances12Eq, Data, Ord, Read, Show, Generic, …
Eq ExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionData ExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionOrd ExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionRead ExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionShow ExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionGeneric ExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionNFData ExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionBinary ExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionParsec ExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionPretty ExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionStructured ExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.Extensiontype Rep Extension = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.Extension"Extension"
"Language.Haskell.Extension"
"Cabal-syntax-3.18.1.0-a008"
'False) (C1 ('MetaCons"EnableExtension"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 KnownExtension)) :+: (C1 ('MetaCons"DisableExtension"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 KnownExtension)) :+: C1 ('MetaCons"UnknownExtension"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))
Known Haskell language extensions, including deprecated and undocumented ones.
Check “Overview of all language extensions” in GHC User’s Guide for more information.
Constructors
OverlappingInstancesAllow overlapping class instances, provided there is a unique most specific instance for each use.
UndecidableInstancesIgnore structural rules guaranteeing the termination of class instance resolution. Termination is guaranteed by a fixed-depth recursion stack, and compilation may fail if this depth is exceeded.
IncoherentInstancesImplies OverlappingInstances. Allow the implementation to choose an instance even when it is possible that further instantiation of types will lead to a more specific instance being applicable.
DoRec(deprecated) Deprecated in favour of RecursiveDo.
Old description: Allow recursive bindings in
doblocks, using thereckeyword. See also RecursiveDo.RecursiveDoAllow recursive bindings in
doblocks, using thereckeyword, ormdo, a variant ofdo.ParallelListCompProvide syntax for writing list comprehensions which iterate over several lists together, like the zipWith family of functions.
MultiParamTypeClassesAllow multiple parameters in a type class.
MonomorphismRestrictionEnable the dreaded monomorphism restriction.
DeepSubsumptionEnable deep subsumption, relaxing the simple subsumption rules, implicitly inserting eta-expansions when matching up function types with different quantification structures.
FunctionalDependenciesAllow a specification attached to a multi-parameter type class which indicates that some parameters are entirely determined by others. The implementation will check that this property holds for the declared instances, and will use this property to reduce ambiguity in instance resolution.
Rank2Types(deprecated) A synonym for RankNTypes.
Old description: Like RankNTypes but does not allow a higher-rank type to itself appear on the left of a function arrow.
RankNTypesAllow a universally-quantified type to occur on the left of a function arrow.
PolymorphicComponents(deprecated) A synonym for RankNTypes.
Old description: Allow data constructors to have polymorphic arguments. Unlike RankNTypes, does not allow this for ordinary functions.
ExistentialQuantificationAllow existentially-quantified data constructors.
ScopedTypeVariablesCause a type variable in a signature, which has an explicit
forallquantifier, to scope over the definition of the accompanying value declaration.PatternSignaturesDeprecated, use ScopedTypeVariables instead.
ImplicitParamsEnable implicit function parameters with dynamic scope.
FlexibleContextsRelax some restrictions on the form of the context of a type signature.
FlexibleInstancesRelax some restrictions on the form of the context of an instance declaration.
EmptyDataDeclsAllow data type declarations with no constructors.
CPPRun the C preprocessor on Haskell source code.
KindSignaturesAllow an explicit kind signature giving the kind of types over which a type variable ranges.
BangPatternsEnable a form of pattern which forces evaluation before an attempted match, and a form of strict
let/wherebinding.TypeSynonymInstancesAllow type synonyms in instance heads.
TemplateHaskellEnable Template Haskell, a system for compile-time metaprogramming.
ForeignFunctionInterfaceEnable the Foreign Function Interface. In GHC, implements the standard Haskell 98 Foreign Function Interface Addendum, plus some GHC-specific extensions.
ArrowsEnable arrow notation.
Generics(deprecated) Enable generic type classes, with default instances defined in terms of the algebraic structure of a type.
ImplicitPreludeNamedFieldPunsEnable syntax for implicitly binding local names corresponding to the field names of a record. Puns bind specific names, unlike RecordWildCards.
PatternGuardsEnable a form of guard which matches a pattern and binds variables.
GeneralizedNewtypeDerivingAllow a type declared with
newtypeto usederivingfor any class with an instance for the underlying type.GeneralisedNewtypeDerivingExtensibleRecordsEnable the "Trex" extensible records system.
RestrictedTypeSynonymsEnable type synonyms which are transparent in some definitions and opaque elsewhere, as a way of implementing abstract datatypes.
HereDocumentsEnable an alternate syntax for string literals, with string templating.
MagicHashAllow the character
#as a postfix modifier on identifiers. Also enables literal syntax for unboxed values.TypeFamiliesAllow data types and type synonyms which are indexed by types, i.e. ad-hoc polymorphism for types.
StandaloneDerivingAllow a standalone declaration which invokes the type class
derivingmechanism.UnicodeSyntaxAllow certain Unicode characters to stand for certain ASCII character sequences, e.g. keywords and punctuation.
UnliftedFFITypesAllow the use of unboxed types as foreign types, e.g. in
foreign importandforeign export.InterruptibleFFIEnable interruptible FFI.
CApiFFIAllow use of CAPI FFI calling convention (
foreign import capi).LiberalTypeSynonymsDefer validity checking of types until after expanding type synonyms, relaxing the constraints on how synonyms may be used.
TypeOperatorsAllow the name of a type constructor, type class, or type variable to be an infix operator.
RecordWildCardsEnable syntax for implicitly binding local names corresponding to the field names of a record. A wildcard binds all unmentioned names, unlike NamedFieldPuns.
RecordPunsDeprecated, use NamedFieldPuns instead.
DisambiguateRecordFieldsAllow a record field name to be disambiguated by the type of the record it's in.
TraditionalRecordSyntaxEnable traditional record syntax (as supported by Haskell 98)
OverloadedStringsEnable overloading of string literals using a type class, much like integer literals.
GADTsEnable generalized algebraic data types, in which type variables may be instantiated on a per-constructor basis. Implies GADTSyntax.
GADTSyntaxEnable GADT syntax for declaring ordinary algebraic datatypes.
MonoPatBinds(deprecated) Has no effect.
Old description: Make pattern bindings monomorphic.
RelaxedPolyRecRelax the requirements on mutually-recursive polymorphic functions.
ExtendedDefaultRulesAllow default instantiation of polymorphic types in more situations.
NamedDefaultsAllow
defaultdeclarations to explicitly name the class and be exported.UnboxedTuplesEnable unboxed tuples.
DeriveDataTypeableEnable
derivingfor classesData.Typeable.TypeableandData.Generics.Data.DeriveGenericDefaultSignaturesEnable support for default signatures.
InstanceSigsAllow type signatures to be specified in instance declarations.
ConstrainedClassMethodsAllow a class method's type to place additional constraints on a class type variable.
PackageImportsAllow imports to be qualified by the package name the module is intended to be imported from, e.g.
import "network" Network.SocketImpredicativeTypes(deprecated) Allow a type variable to be instantiated at a polymorphic type.
NewQualifiedOperators(deprecated) Change the syntax for qualified infix operators.
PostfixOperatorsRelax the interpretation of left operator sections to allow unary postfix operators.
QuasiQuotesEnable quasi-quotation, a mechanism for defining new concrete syntax for expressions and patterns.
TransformListCompEnable generalized list comprehensions, supporting operations such as sorting and grouping.
MonadComprehensionsEnable monad comprehensions, which generalise the list comprehension syntax to work for any monad.
ViewPatternsEnable view patterns, which match a value by applying a function and matching on the result.
XmlSyntaxAllow concrete XML syntax to be used in expressions and patterns, as per the Haskell Server Pages extension language: http://www.haskell.org/haskellwiki/HSP. The ideas behind it are discussed in the paper "Haskell Server Pages through Dynamic Loading" by Niklas Broberg, from Haskell Workshop '05.
RegularPatternsAllow regular pattern matching over lists, as discussed in the paper "Regular Expression Patterns" by Niklas Broberg, Andreas Farre and Josef Svenningsson, from ICFP '04.
TupleSectionsEnable the use of tuple sections, e.g.
(, True)desugars intox -> (x, True).GHCForeignImportPrimAllow GHC primops, written in C--, to be imported into a Haskell file.
NPlusKPatternsSupport for patterns of the form
n + k, wherekis an integer literal.DoAndIfThenElseImprove the layout rule when
ifexpressions are used in adoblock.MultiWayIfEnable support for multi-way
if-expressions.LambdaCaseEnable support lambda-
caseexpressions.RebindableSyntaxMakes much of the Haskell sugar be desugared into calls to the function with a particular name that is in scope.
ExplicitForAllMake
foralla keyword in types, which can be used to give the generalisation explicitly.DatatypeContextsAllow contexts to be put on datatypes, e.g. the
Eq aindata Eq a => Set a = NilSet | ConsSet a (Set a).MonoLocalBindsLocal (
letandwhere) bindings are monomorphic.DeriveFunctorEnable
derivingfor theData.Functor.Functorclass.DeriveTraversableEnable
derivingfor the Traversable class.DeriveFoldableEnable
derivingfor the Foldable class.NondecreasingIndentationEnable non-decreasing indentation for
doblocks.SafeImportsAllow imports to be qualified with a safe keyword that requires the imported module be trusted as according to the Safe Haskell definition of trust.
import safe Network.SocketSafeCompile a module in the Safe, Safe Haskell mode -- a restricted form of the Haskell language to ensure type safety.
TrustworthyCompile a module in the Trustworthy, Safe Haskell mode -- no restrictions apply but the module is marked as trusted as long as the package the module resides in is trusted.
UnsafeCompile a module in the Unsafe, Safe Haskell mode so that modules compiled using Safe, Safe Haskell mode can't import it.
ConstraintKindsAllow type classimplicit parameterequality constraints to be used as types with the special kind constraint. Also generalise the
(ctxt => ty)syntax so that any type of kind constraint can occur before the arrow.PolyKindsEnable kind polymorphism.
DataKindsEnable datatype promotion.
TypeDataEnable
type datadeclarations, defining constructors at the type level.ParallelArraysEnable parallel arrays syntax (
[:,:]) for Data Parallel Haskell.RoleAnnotationsEnable explicit role annotations, like in (
type role Foo representational representational).OverloadedListsEnable overloading of list literals, arithmetic sequences and list patterns using the
IsListtype class.EmptyCaseEnable case expressions that have no alternatives. Also applies to lambda-case expressions if they are enabled.
AutoDeriveTypeable(deprecated) Deprecated in favour of DeriveDataTypeable.
Old description: Triggers the generation of derived Typeable instances for every datatype and type class declaration.
NegativeLiteralsDesugars negative literals directly (without using negate).
BinaryLiteralsAllow the use of binary integer literal syntax (e.g.
0b11001001to denote201).NumDecimalsNullaryTypeClassesEnable support for type classes with no type parameter.
ExplicitNamespacesEnable explicit namespaces in module import/export lists.
AllowAmbiguousTypesAllow the user to write ambiguous types, and the type inference engine to infer them.
JavaScriptFFIEnable
foreign import javascript.PatternSynonymsAllow giving names to and abstracting over patterns.
PartialTypeSignaturesAllow anonymous placeholders (underscore) inside type signatures. The type inference engine will generate a message describing the type inferred at the hole's location.
NamedWildCardsAllow named placeholders written with a leading underscore inside type signatures. Wildcards with the same name unify to the same type.
DeriveAnyClassEnable
derivingfor any class.DeriveLiftEnable
derivingfor the Lift class.StaticPointersEnable support for 'static pointers' (and the
statickeyword) to refer to globally stable names, even across different programs.StrictDataSwitches data type declarations to be strict by default (as if they had a bang using
BangPatterns), and allow opt-in field laziness using~.StrictSwitches all pattern bindings to be strict by default (as if they had a bang using
BangPatterns), ordinary patterns are recovered using~. ImpliesStrictData.ApplicativeDoAllows
do-notation for types that areApplicativeas well asMonad. When enabled, desugaringdonotation tries to use(*)andfmapandjoinas far as possible.DuplicateRecordFieldsAllow records to use duplicated field labels for accessors.
TypeApplicationsEnable explicit type applications with the syntax
id @Int.TypeInTypeDissolve the distinction between types and kinds, allowing the compiler to reason about kind equality and therefore enabling GADTs to be promoted to the type-level.
UndecidableSuperClassesAllow recursive (and therefore undecidable) super-class relationships.
MonadFailDesugaringA temporary extension to help library authors check if their code will compile with the new planned desugaring of fail.
TemplateHaskellQuotesA subset of
TemplateHaskellincluding only quoting.OverloadedLabelsAllows use of the
#labelsyntax.TypeFamilyDependenciesAllow functional dependency annotations on type families to declare them as injective.
DerivingStrategiesAllow multiple
derivingclauses, each optionally qualified with a strategy.DerivingViaEnable deriving instances via types of the same runtime representation. Implies DerivingStrategies.
UnboxedSumsEnable the use of unboxed sum syntax.
HexFloatLiteralsAllow use of hexadecimal literal notation for floating-point values.
BlockArgumentsAllow
doblocks etc. in argument position.NumericUnderscoresAllow use of underscores in numeric literals.
QuantifiedConstraintsAllow
forallin constraints.StarIsTypeHave
*refer toType.EmptyDataDerivingLiberalises deriving to provide instances for empty data types.
CUSKsEnable detection of complete user-supplied kind signatures.
ImportQualifiedPostAllows the syntax
import M qualified.StandaloneKindSignaturesAllow the use of standalone kind signatures.
UnliftedNewtypesEnable unlifted newtypes.
LexicalNegationUse whitespace to determine whether the minus sign stands for negation or subtraction.
QualifiedDoEnable qualified do-notation desugaring.
LinearTypesEnable linear types.
RequiredTypeArgumentsAllow the use of visible forall in types of terms.
FieldSelectorsEnable the generation of selector functions corresponding to record fields.
OverloadedRecordDotEnable the use of record dot-accessor and updater syntax
OverloadedRecordUpdateProvides record
.syntax in record updates, e.g.x {foo.bar = 1}.UnliftedDatatypesEnable data types for which an unlifted or levity-polymorphic result kind is inferred.
ExtendedLiteralsEnable syntax for primitive numeric literals, e.g.
3#Int8AlternativeLayoutRuleUndocumented parsing-related extensions introduced in GHC 7.0.
AlternativeLayoutRuleTransitionalUndocumented parsing-related extensions introduced in GHC 7.0.
RelaxedLayoutUndocumented parsing-related extensions introduced in GHC 7.2.
TypeAbstractionsAllow the use of type abstraction syntax.
ListTuplePunsAllow the use of built-in syntax for list, tuple and sum type constructors rather than being exclusive to data constructors.
MultilineStringsSupport multiline strings.
OrPatternsAllow use of or-pattern syntax, condensing multiple patterns into a single one.
ExplicitLevelImportsAlong with ImplicitStagePersistence, this gives fine-grained control over which modules are needed at each stage of execution.
ImplicitStagePersistenceAllow identifiers to be used at different levels than where they’re defined, using path-based persistence.
QualifiedStringsEnable qualified string literals.
ModifiersEnable modifier syntax.
Instances13Bounded, Enum, Eq, Data, Ord, Read, …
Bounded KnownExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionEnum KnownExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionEq KnownExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionData KnownExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionOrd KnownExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionRead KnownExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionShow KnownExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionGeneric KnownExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionNFData KnownExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionBinary KnownExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionPretty KnownExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionStructured KnownExtensionDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.Extensiontype Rep KnownExtension = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.Extension"KnownExtension"
"Language.Haskell.Extension"
"Cabal-syntax-3.18.1.0-a008"
'False) (((((((C1 ('MetaCons"OverlappingInstances"
'PrefixI 'False) U1 :+: C1 ('MetaCons"UndecidableInstances"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"IncoherentInstances"
'PrefixI 'False) U1 :+: C1 ('MetaCons"DoRec"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"RecursiveDo"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ParallelListComp"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"MultiParamTypeClasses"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"MonomorphismRestriction"
'PrefixI 'False) U1 :+: C1 ('MetaCons"DeepSubsumption"
'PrefixI 'False) U1)))) :+: (((C1 ('MetaCons"FunctionalDependencies"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Rank2Types"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"RankNTypes"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"PolymorphicComponents"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ExistentialQuantification"
'PrefixI 'False) U1))) :+: ((C1 ('MetaCons"ScopedTypeVariables"
'PrefixI 'False) U1 :+: C1 ('MetaCons"PatternSignatures"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"ImplicitParams"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"FlexibleContexts"
'PrefixI 'False) U1 :+: C1 ('MetaCons"FlexibleInstances"
'PrefixI 'False) U1))))) :+: ((((C1 ('MetaCons"EmptyDataDecls"
'PrefixI 'False) U1 :+: C1 ('MetaCons"CPP"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"KindSignatures"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"BangPatterns"
'PrefixI 'False) U1 :+: C1 ('MetaCons"TypeSynonymInstances"
'PrefixI 'False) U1))) :+: ((C1 ('MetaCons"TemplateHaskell"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ForeignFunctionInterface"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"Arrows"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"Generics"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ImplicitPrelude"
'PrefixI 'False) U1)))) :+: (((C1 ('MetaCons"NamedFieldPuns"
'PrefixI 'False) U1 :+: C1 ('MetaCons"PatternGuards"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"GeneralizedNewtypeDeriving"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"GeneralisedNewtypeDeriving"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ExtensibleRecords"
'PrefixI 'False) U1))) :+: ((C1 ('MetaCons"RestrictedTypeSynonyms"
'PrefixI 'False) U1 :+: C1 ('MetaCons"HereDocuments"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"MagicHash"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"TypeFamilies"
'PrefixI 'False) U1 :+: C1 ('MetaCons"StandaloneDeriving"
'PrefixI 'False) U1)))))) :+: (((((C1 ('MetaCons"UnicodeSyntax"
'PrefixI 'False) U1 :+: C1 ('MetaCons"UnliftedFFITypes"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"InterruptibleFFI"
'PrefixI 'False) U1 :+: C1 ('MetaCons"CApiFFI"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"LiberalTypeSynonyms"
'PrefixI 'False) U1 :+: C1 ('MetaCons"TypeOperators"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"RecordWildCards"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"RecordPuns"
'PrefixI 'False) U1 :+: C1 ('MetaCons"DisambiguateRecordFields"
'PrefixI 'False) U1)))) :+: (((C1 ('MetaCons"TraditionalRecordSyntax"
'PrefixI 'False) U1 :+: C1 ('MetaCons"OverloadedStrings"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"GADTs"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"GADTSyntax"
'PrefixI 'False) U1 :+: C1 ('MetaCons"MonoPatBinds"
'PrefixI 'False) U1))) :+: ((C1 ('MetaCons"RelaxedPolyRec"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ExtendedDefaultRules"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"NamedDefaults"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"UnboxedTuples"
'PrefixI 'False) U1 :+: C1 ('MetaCons"DeriveDataTypeable"
'PrefixI 'False) U1))))) :+: ((((C1 ('MetaCons"DeriveGeneric"
'PrefixI 'False) U1 :+: C1 ('MetaCons"DefaultSignatures"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"InstanceSigs"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"ConstrainedClassMethods"
'PrefixI 'False) U1 :+: C1 ('MetaCons"PackageImports"
'PrefixI 'False) U1))) :+: ((C1 ('MetaCons"ImpredicativeTypes"
'PrefixI 'False) U1 :+: C1 ('MetaCons"NewQualifiedOperators"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"PostfixOperators"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"QuasiQuotes"
'PrefixI 'False) U1 :+: C1 ('MetaCons"TransformListComp"
'PrefixI 'False) U1)))) :+: (((C1 ('MetaCons"MonadComprehensions"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ViewPatterns"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"XmlSyntax"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"RegularPatterns"
'PrefixI 'False) U1 :+: C1 ('MetaCons"TupleSections"
'PrefixI 'False) U1))) :+: ((C1 ('MetaCons"GHCForeignImportPrim"
'PrefixI 'False) U1 :+: C1 ('MetaCons"NPlusKPatterns"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"DoAndIfThenElse"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"MultiWayIf"
'PrefixI 'False) U1 :+: C1 ('MetaCons"LambdaCase"
'PrefixI 'False) U1))))))) :+: ((((((C1 ('MetaCons"RebindableSyntax"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ExplicitForAll"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"DatatypeContexts"
'PrefixI 'False) U1 :+: C1 ('MetaCons"MonoLocalBinds"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"DeriveFunctor"
'PrefixI 'False) U1 :+: C1 ('MetaCons"DeriveTraversable"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"DeriveFoldable"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"NondecreasingIndentation"
'PrefixI 'False) U1 :+: C1 ('MetaCons"SafeImports"
'PrefixI 'False) U1)))) :+: (((C1 ('MetaCons"Safe"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Trustworthy"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"Unsafe"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"ConstraintKinds"
'PrefixI 'False) U1 :+: C1 ('MetaCons"PolyKinds"
'PrefixI 'False) U1))) :+: ((C1 ('MetaCons"DataKinds"
'PrefixI 'False) U1 :+: C1 ('MetaCons"TypeData"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"ParallelArrays"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"RoleAnnotations"
'PrefixI 'False) U1 :+: C1 ('MetaCons"OverloadedLists"
'PrefixI 'False) U1))))) :+: ((((C1 ('MetaCons"EmptyCase"
'PrefixI 'False) U1 :+: C1 ('MetaCons"AutoDeriveTypeable"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"NegativeLiterals"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"BinaryLiterals"
'PrefixI 'False) U1 :+: C1 ('MetaCons"NumDecimals"
'PrefixI 'False) U1))) :+: ((C1 ('MetaCons"NullaryTypeClasses"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ExplicitNamespaces"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"AllowAmbiguousTypes"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"JavaScriptFFI"
'PrefixI 'False) U1 :+: C1 ('MetaCons"PatternSynonyms"
'PrefixI 'False) U1)))) :+: (((C1 ('MetaCons"PartialTypeSignatures"
'PrefixI 'False) U1 :+: C1 ('MetaCons"NamedWildCards"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"DeriveAnyClass"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"DeriveLift"
'PrefixI 'False) U1 :+: C1 ('MetaCons"StaticPointers"
'PrefixI 'False) U1))) :+: ((C1 ('MetaCons"StrictData"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Strict"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"ApplicativeDo"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"DuplicateRecordFields"
'PrefixI 'False) U1 :+: C1 ('MetaCons"TypeApplications"
'PrefixI 'False) U1)))))) :+: (((((C1 ('MetaCons"TypeInType"
'PrefixI 'False) U1 :+: C1 ('MetaCons"UndecidableSuperClasses"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"MonadFailDesugaring"
'PrefixI 'False) U1 :+: C1 ('MetaCons"TemplateHaskellQuotes"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"OverloadedLabels"
'PrefixI 'False) U1 :+: C1 ('MetaCons"TypeFamilyDependencies"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"DerivingStrategies"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"DerivingVia"
'PrefixI 'False) U1 :+: C1 ('MetaCons"UnboxedSums"
'PrefixI 'False) U1)))) :+: (((C1 ('MetaCons"HexFloatLiterals"
'PrefixI 'False) U1 :+: C1 ('MetaCons"BlockArguments"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"NumericUnderscores"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"QuantifiedConstraints"
'PrefixI 'False) U1 :+: C1 ('MetaCons"StarIsType"
'PrefixI 'False) U1))) :+: ((C1 ('MetaCons"EmptyDataDeriving"
'PrefixI 'False) U1 :+: C1 ('MetaCons"CUSKs"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"ImportQualifiedPost"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"StandaloneKindSignatures"
'PrefixI 'False) U1 :+: C1 ('MetaCons"UnliftedNewtypes"
'PrefixI 'False) U1))))) :+: ((((C1 ('MetaCons"LexicalNegation"
'PrefixI 'False) U1 :+: C1 ('MetaCons"QualifiedDo"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"LinearTypes"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"RequiredTypeArguments"
'PrefixI 'False) U1 :+: C1 ('MetaCons"FieldSelectors"
'PrefixI 'False) U1))) :+: ((C1 ('MetaCons"OverloadedRecordDot"
'PrefixI 'False) U1 :+: C1 ('MetaCons"OverloadedRecordUpdate"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"UnliftedDatatypes"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"ExtendedLiterals"
'PrefixI 'False) U1 :+: C1 ('MetaCons"AlternativeLayoutRule"
'PrefixI 'False) U1)))) :+: (((C1 ('MetaCons"AlternativeLayoutRuleTransitional"
'PrefixI 'False) U1 :+: C1 ('MetaCons"RelaxedLayout"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"TypeAbstractions"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"ListTuplePuns"
'PrefixI 'False) U1 :+: C1 ('MetaCons"MultilineStrings"
'PrefixI 'False) U1))) :+: ((C1 ('MetaCons"OrPatterns"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ExplicitLevelImports"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"ImplicitStagePersistence"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"QualifiedStrings"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Modifiers"
'PrefixI 'False) U1))))))))
This represents a Haskell language dialect.
Language Extensions are interpreted relative to one of these base languages.
Constructors
Haskell98The Haskell 98 language as defined by the Haskell 98 report. http://haskell.org/onlinereport/
Haskell2010The Haskell 2010 language as defined by the Haskell 2010 report. http://www.haskell.org/onlinereport/haskell2010
GHC2021The GHC2021 collection of language extensions. https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0380-ghc2021.rst
GHC2024The GHC2024 collection of language extensions. https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0613-ghc2024.rst
UnknownLanguage StringAn unknown language, identified by its name.
Instances12Eq, Data, Ord, Read, Show, Generic, …
Eq LanguageDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionData LanguageDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionOrd LanguageDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionRead LanguageDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionShow LanguageDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionGeneric LanguageDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionNFData LanguageDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionBinary LanguageDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionParsec LanguageDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionPretty LanguageDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.ExtensionStructured LanguageDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.Extensiontype Rep Language = D1 ('MetaDataDefined in Cabal-syntax-3.18.1.0 · Language.Haskell.Extension"Language"
"Language.Haskell.Extension"
"Cabal-syntax-3.18.1.0-a008"
'False) ((C1 ('MetaCons"Haskell98"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Haskell2010"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"GHC2021"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"GHC2024"
'PrefixI 'False) U1 :+: C1 ('MetaCons"UnknownLanguage"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))))
Simple interface
4 declarationsA simple implementation of main for a Cabal setup script.
It reads the package description file using IO, and performs the
action specified on the command line.
Like defaultMain, but accepts the package description as input rather than using IO to read it.
A version of defaultMain that is passed the command line arguments, rather than getting them from the environment.
A version of defaultMainArgs that allows passing explicit verbosity handles.
Customization
8 declarationsHooks allow authors to add specific functionality before and after a command is run, and also to specify additional preprocessors.
WARNING: The hooks interface is under rather constant flux as we try to understand users needs. Setup files that depend on this interface may break in future releases.
Constructors
UserHooksreadDesc :: IO (Maybe GenericPackageDescription)Read the description file
hookedPreProcessors :: [PPSuffixHandler]Custom preprocessors in addition to and overriding knownSuffixHandlers.
hookedPrograms :: [Program]These programs are detected at configure time. Arguments for them are added to the configure command.
preConf :: Args -> ConfigFlags -> IO HookedBuildInfoHook to run before configure command
confHook :: (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfoOver-ride this hook to get different behavior during configure.
postConf :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()Hook to run after configure command
preBuild :: Args -> BuildFlags -> IO HookedBuildInfoHook to run before build command. Second arg indicates verbosity level.
buildHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()Over-ride this hook to get different behavior during build.
postBuild :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()Hook to run after build command. Second arg indicates verbosity level.
preRepl :: Args -> ReplFlags -> IO HookedBuildInfoHook to run before repl command. Second arg indicates verbosity level.
replHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> ReplFlags -> [String] -> IO ()Over-ride this hook to get different behavior during interpretation.
postRepl :: Args -> ReplFlags -> PackageDescription -> LocalBuildInfo -> IO ()Hook to run after repl command. Second arg indicates verbosity level.
preClean :: Args -> CleanFlags -> IO HookedBuildInfoHook to run before clean command. Second arg indicates verbosity level.
cleanHook :: PackageDescription -> () -> UserHooks -> CleanFlags -> IO ()Over-ride this hook to get different behavior during clean.
postClean :: Args -> CleanFlags -> PackageDescription -> () -> IO ()Hook to run after clean command. Second arg indicates verbosity level.
preCopy :: Args -> CopyFlags -> IO HookedBuildInfoHook to run before copy command
copyHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO ()Over-ride this hook to get different behavior during copy.
postCopy :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()Hook to run after copy command
preInst :: Args -> InstallFlags -> IO HookedBuildInfoHook to run before install command
instHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO ()Over-ride this hook to get different behavior during install.
postInst :: Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()Hook to run after install command. postInst should be run on the target, not on the build machine.
preReg :: Args -> RegisterFlags -> IO HookedBuildInfoHook to run before register command
regHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()Over-ride this hook to get different behavior during registration.
postReg :: Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()Hook to run after register command
preUnreg :: Args -> RegisterFlags -> IO HookedBuildInfoHook to run before unregister command
unregHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()Over-ride this hook to get different behavior during unregistration.
postUnreg :: Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()Hook to run after unregister command
preHscolour :: Args -> HscolourFlags -> IO HookedBuildInfoHook to run before hscolour command. Second arg indicates verbosity level.
hscolourHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO ()Over-ride this hook to get different behavior during hscolour.
postHscolour :: Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO ()Hook to run after hscolour command. Second arg indicates verbosity level.
preHaddock :: Args -> HaddockFlags -> IO HookedBuildInfoHook to run before haddock command. Second arg indicates verbosity level.
haddockHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO ()Over-ride this hook to get different behavior during haddock.
postHaddock :: Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO ()Hook to run after haddock command. Second arg indicates verbosity level.
preTest :: Args -> TestFlags -> IO HookedBuildInfoHook to run before test command.
testHook :: Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> TestFlags -> IO ()Over-ride this hook to get different behavior during test.
postTest :: Args -> TestFlags -> PackageDescription -> LocalBuildInfo -> IO ()Hook to run after test command.
preBench :: Args -> BenchmarkFlags -> IO HookedBuildInfoHook to run before bench command.
benchHook :: Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> BenchmarkFlags -> IO ()Over-ride this hook to get different behavior during bench.
postBench :: Args -> BenchmarkFlags -> PackageDescription -> LocalBuildInfo -> IO ()Hook to run after bench command.
A customizable version of defaultMain.
A customizable version of defaultMain that also takes the command line arguments.
A customizable version of defaultMainNoRead.
A customizable version of defaultMainNoRead that also takes the command line arguments.
Standard sets of hooks
Hooks that correspond to a plain instantiation of the "simple" build system
A version of simpleUserHooks that allows setting custom logging handles.
Empty UserHooks which do nothing.