Copyright | [2017] Trevor L. McDonell |
---|---|
License | BSD3 |
Maintainer | Trevor L. McDonell <tmcdonell@cse.unsw.edu.au> |
Stability | experimental |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Data.Array.Accelerate.LLVM.Native.Distribution.Simple
Description
Synopsis
- defaultMain :: IO ()
- simpleUserHooks :: UserHooks
- autoconfUserHooks :: UserHooks
- defaultUserHooks :: UserHooks
- defaultMainWithHooksNoReadArgs :: UserHooks -> GenericPackageDescription -> [String] -> IO ()
- defaultMainWithHooksNoRead :: UserHooks -> GenericPackageDescription -> IO ()
- defaultMainNoRead :: GenericPackageDescription -> IO ()
- defaultMainWithHooksArgs :: UserHooks -> [String] -> IO ()
- defaultMainWithHooks :: UserHooks -> IO ()
- defaultMainArgs :: [String] -> IO ()
- emptyUserHooks :: UserHooks
- type Args = [String]
- data UserHooks = UserHooks {
- runTests :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()
- readDesc :: IO (Maybe GenericPackageDescription)
- hookedPreProcessors :: [PPSuffixHandler]
- hookedPrograms :: [Program]
- preConf :: Args -> ConfigFlags -> IO HookedBuildInfo
- confHook :: (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo
- postConf :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()
- preBuild :: Args -> BuildFlags -> IO HookedBuildInfo
- buildHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()
- postBuild :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
- preRepl :: Args -> ReplFlags -> IO HookedBuildInfo
- replHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> ReplFlags -> [String] -> IO ()
- postRepl :: Args -> ReplFlags -> PackageDescription -> LocalBuildInfo -> IO ()
- preClean :: Args -> CleanFlags -> IO HookedBuildInfo
- cleanHook :: PackageDescription -> () -> UserHooks -> CleanFlags -> IO ()
- postClean :: Args -> CleanFlags -> PackageDescription -> () -> IO ()
- preCopy :: Args -> CopyFlags -> IO HookedBuildInfo
- copyHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO ()
- postCopy :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()
- preInst :: Args -> InstallFlags -> IO HookedBuildInfo
- instHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO ()
- postInst :: Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()
- preSDist :: Args -> SDistFlags -> IO HookedBuildInfo
- sDistHook :: PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> SDistFlags -> IO ()
- postSDist :: Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ()
- preReg :: Args -> RegisterFlags -> IO HookedBuildInfo
- regHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()
- postReg :: Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()
- preUnreg :: Args -> RegisterFlags -> IO HookedBuildInfo
- unregHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()
- postUnreg :: Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()
- preHscolour :: Args -> HscolourFlags -> IO HookedBuildInfo
- hscolourHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO ()
- postHscolour :: Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO ()
- preDoctest :: Args -> DoctestFlags -> IO HookedBuildInfo
- doctestHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> DoctestFlags -> IO ()
- postDoctest :: Args -> DoctestFlags -> PackageDescription -> LocalBuildInfo -> IO ()
- preHaddock :: Args -> HaddockFlags -> IO HookedBuildInfo
- haddockHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO ()
- postHaddock :: Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO ()
- preTest :: Args -> TestFlags -> IO HookedBuildInfo
- testHook :: Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> TestFlags -> IO ()
- postTest :: Args -> TestFlags -> PackageDescription -> LocalBuildInfo -> IO ()
- preBench :: Args -> BenchmarkFlags -> IO HookedBuildInfo
- benchHook :: Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> BenchmarkFlags -> IO ()
- postBench :: Args -> BenchmarkFlags -> PackageDescription -> LocalBuildInfo -> IO ()
- showProfDetailLevel :: ProfDetailLevel -> String
- knownProfDetailLevels :: [(String, [String], ProfDetailLevel)]
- flagToProfDetailLevel :: String -> ProfDetailLevel
- profilingSupported :: Compiler -> Bool
- coverageSupported :: Compiler -> Bool
- arResponseFilesSupported :: Compiler -> Bool
- libraryDynDirSupported :: Compiler -> Bool
- backpackSupported :: Compiler -> Bool
- unitIdSupported :: Compiler -> Bool
- packageKeySupported :: Compiler -> Bool
- unifiedIPIDRequired :: Compiler -> Bool
- renamingPackageFlagsSupported :: Compiler -> Bool
- reexportedModulesSupported :: Compiler -> Bool
- parmakeSupported :: Compiler -> Bool
- extensionsToFlags :: Compiler -> [Extension] -> [Flag]
- unsupportedExtensions :: Compiler -> [Extension] -> [Extension]
- languageToFlags :: Compiler -> Maybe Language -> [Flag]
- unsupportedLanguages :: Compiler -> [Language] -> [Language]
- flagToDebugInfoLevel :: Maybe String -> DebugInfoLevel
- flagToOptimisationLevel :: Maybe String -> OptimisationLevel
- absolutePackageDBPath :: PackageDB -> NoCallStackIO PackageDB
- absolutePackageDBPaths :: PackageDBStack -> NoCallStackIO PackageDBStack
- registrationPackageDB :: PackageDBStack -> PackageDB
- compilerInfo :: Compiler -> CompilerInfo
- compilerCompatVersion :: CompilerFlavor -> Compiler -> Maybe Version
- compilerCompatFlavor :: CompilerFlavor -> Compiler -> Bool
- compilerVersion :: Compiler -> Version
- compilerFlavor :: Compiler -> CompilerFlavor
- showCompilerIdWithAbi :: Compiler -> String
- showCompilerId :: Compiler -> String
- data Compiler = Compiler {
- compilerId :: CompilerId
- compilerAbiTag :: AbiTag
- compilerCompat :: [CompilerId]
- compilerLanguages :: [(Language, Flag)]
- compilerExtensions :: [(Extension, Maybe Flag)]
- compilerProperties :: Map String String
- data PackageDB
- type PackageDBStack = [PackageDB]
- data OptimisationLevel
- data DebugInfoLevel
- data ProfDetailLevel
- defaultHookedPackageDesc :: IO (Maybe FilePath)
- installedPackageId :: HasUnitId pkg => pkg -> UnitId
- packageVersion :: Package pkg => pkg -> Version
- packageName :: Package pkg => pkg -> PackageName
- mungedVersion' :: HasMungedPackageId munged => munged -> Version
- mungedName' :: HasMungedPackageId pkg => pkg -> MungedPackageName
- class Package pkg where
- class HasMungedPackageId pkg where
- class Package pkg => HasUnitId pkg where
- class HasUnitId pkg => PackageInstalled pkg where
- simplifyDependency :: Dependency -> Dependency
- notThisPackageVersion :: PackageIdentifier -> Dependency
- thisPackageVersion :: PackageIdentifier -> Dependency
- depVerRange :: Dependency -> VersionRange
- depPkgName :: Dependency -> PackageName
- data Dependency = Dependency PackageName VersionRange
- data Module = Module DefUnitId ModuleName
- unsafeMkDefUnitId :: UnitId -> DefUnitId
- getHSLibraryName :: UnitId -> String
- mkLegacyUnitId :: PackageId -> UnitId
- newSimpleUnitId :: ComponentId -> UnitId
- mkUnitId :: String -> UnitId
- unUnitId :: UnitId -> String
- data UnitId
- type InstalledPackageId = UnitId
- data DefUnitId
- type PackageId = PackageIdentifier
- data PackageIdentifier = PackageIdentifier {}
- mkPackageName :: String -> PackageName
- unPackageName :: PackageName -> String
- data PackageName
- unknownCompilerInfo :: CompilerId -> AbiTag -> CompilerInfo
- abiTagString :: AbiTag -> String
- defaultCompilerFlavor :: Maybe CompilerFlavor
- buildCompilerId :: CompilerId
- buildCompilerFlavor :: CompilerFlavor
- parseCompilerFlavorCompat :: ReadP r CompilerFlavor
- classifyCompilerFlavor :: String -> CompilerFlavor
- data CompilerFlavor
- data CompilerId = CompilerId CompilerFlavor Version
- data CompilerInfo = CompilerInfo {}
- data AbiTag
- classifyExtension :: String -> Extension
- deprecatedExtensions :: [(Extension, Maybe Extension)]
- knownExtensions :: [KnownExtension]
- classifyLanguage :: String -> Language
- knownLanguages :: [Language]
- data Language
- data Extension
- data KnownExtension
- = OverlappingInstances
- | UndecidableInstances
- | IncoherentInstances
- | DoRec
- | RecursiveDo
- | ParallelListComp
- | MultiParamTypeClasses
- | MonomorphismRestriction
- | FunctionalDependencies
- | Rank2Types
- | RankNTypes
- | PolymorphicComponents
- | ExistentialQuantification
- | ScopedTypeVariables
- | PatternSignatures
- | ImplicitParams
- | FlexibleContexts
- | FlexibleInstances
- | EmptyDataDecls
- | CPP
- | KindSignatures
- | BangPatterns
- | TypeSynonymInstances
- | TemplateHaskell
- | ForeignFunctionInterface
- | Arrows
- | Generics
- | ImplicitPrelude
- | NamedFieldPuns
- | PatternGuards
- | GeneralizedNewtypeDeriving
- | ExtensibleRecords
- | RestrictedTypeSynonyms
- | HereDocuments
- | MagicHash
- | TypeFamilies
- | StandaloneDeriving
- | UnicodeSyntax
- | UnliftedFFITypes
- | InterruptibleFFI
- | CApiFFI
- | LiberalTypeSynonyms
- | TypeOperators
- | RecordWildCards
- | RecordPuns
- | DisambiguateRecordFields
- | TraditionalRecordSyntax
- | OverloadedStrings
- | GADTs
- | GADTSyntax
- | MonoPatBinds
- | RelaxedPolyRec
- | ExtendedDefaultRules
- | UnboxedTuples
- | DeriveDataTypeable
- | DeriveGeneric
- | DefaultSignatures
- | InstanceSigs
- | ConstrainedClassMethods
- | PackageImports
- | ImpredicativeTypes
- | NewQualifiedOperators
- | PostfixOperators
- | QuasiQuotes
- | TransformListComp
- | MonadComprehensions
- | ViewPatterns
- | XmlSyntax
- | RegularPatterns
- | TupleSections
- | GHCForeignImportPrim
- | NPlusKPatterns
- | DoAndIfThenElse
- | MultiWayIf
- | LambdaCase
- | RebindableSyntax
- | ExplicitForAll
- | DatatypeContexts
- | MonoLocalBinds
- | DeriveFunctor
- | DeriveTraversable
- | DeriveFoldable
- | NondecreasingIndentation
- | SafeImports
- | Safe
- | Trustworthy
- | Unsafe
- | ConstraintKinds
- | PolyKinds
- | DataKinds
- | ParallelArrays
- | RoleAnnotations
- | OverloadedLists
- | EmptyCase
- | AutoDeriveTypeable
- | NegativeLiterals
- | BinaryLiterals
- | NumDecimals
- | NullaryTypeClasses
- | ExplicitNamespaces
- | AllowAmbiguousTypes
- | JavaScriptFFI
- | PatternSynonyms
- | PartialTypeSignatures
- | NamedWildCards
- | DeriveAnyClass
- | DeriveLift
- | StaticPointers
- | StrictData
- | Strict
- | ApplicativeDo
- | DuplicateRecordFields
- | TypeApplications
- | TypeInType
- | UndecidableSuperClasses
- | MonadFailDesugaring
- | TemplateHaskellQuotes
- | OverloadedLabels
- | TypeFamilyDependencies
- | DerivingStrategies
- | UnboxedSums
- | HexFloatLiterals
- licenseFromSPDX :: License -> License
- licenseToSPDX :: License -> License
- knownLicenses :: [License]
- data License
- = GPL (Maybe Version)
- | AGPL (Maybe Version)
- | LGPL (Maybe Version)
- | BSD2
- | BSD3
- | BSD4
- | MIT
- | ISC
- | MPL Version
- | Apache (Maybe Version)
- | PublicDomain
- | AllRightsReserved
- | UnspecifiedLicense
- | OtherLicense
- | UnknownLicense String
- foldVersionRange' :: a -> (Version -> a) -> (Version -> a) -> (Version -> a) -> (Version -> a) -> (Version -> a) -> (Version -> Version -> a) -> (Version -> Version -> a) -> (a -> a -> a) -> (a -> a -> a) -> (a -> a) -> VersionRange -> a
- betweenVersionsInclusive :: Version -> Version -> VersionRange
- removeLowerBound :: VersionRange -> VersionRange
- removeUpperBound :: VersionRange -> VersionRange
- invertVersionRange :: VersionRange -> VersionRange
- differenceVersionRanges :: VersionRange -> VersionRange -> VersionRange
- simplifyVersionRange :: VersionRange -> VersionRange
- isSpecificVersion :: VersionRange -> Maybe Version
- isNoVersion :: VersionRange -> Bool
- isAnyVersion :: VersionRange -> Bool
- mkAbiHash :: String -> AbiHash
- unAbiHash :: AbiHash -> String
- data AbiHash
- unComponentId :: ComponentId -> String
- mkComponentId :: String -> ComponentId
- data ComponentId
- mkPkgconfigName :: String -> PkgconfigName
- unPkgconfigName :: PkgconfigName -> String
- data PkgconfigName
- invertVersionIntervals :: VersionIntervals -> VersionIntervals
- intersectVersionIntervals :: VersionIntervals -> VersionIntervals -> VersionIntervals
- unionVersionIntervals :: VersionIntervals -> VersionIntervals -> VersionIntervals
- fromVersionIntervals :: VersionIntervals -> VersionRange
- toVersionIntervals :: VersionRange -> VersionIntervals
- withinIntervals :: Version -> VersionIntervals -> Bool
- mkVersionIntervals :: [VersionInterval] -> VersionIntervals
- versionIntervals :: VersionIntervals -> [VersionInterval]
- asVersionIntervals :: VersionRange -> [VersionInterval]
- data VersionIntervals
- type VersionInterval = (LowerBound, UpperBound)
- data LowerBound = LowerBound Version !Bound
- data UpperBound
- data Bound
- hasLowerBound :: VersionRange -> Bool
- hasUpperBound :: VersionRange -> Bool
- majorUpperBound :: Version -> Version
- wildcardUpperBound :: Version -> Version
- withinRange :: Version -> VersionRange -> Bool
- stripParensVersionRange :: VersionRange -> VersionRange
- normaliseVersionRange :: VersionRange -> VersionRange
- hyloVersionRange :: (VersionRangeF VersionRange -> VersionRange) -> (VersionRange -> VersionRangeF VersionRange) -> VersionRange -> VersionRange
- foldVersionRange :: a -> (Version -> a) -> (Version -> a) -> (Version -> a) -> (a -> a -> a) -> (a -> a -> a) -> VersionRange -> a
- anaVersionRange :: (a -> VersionRangeF a) -> a -> VersionRange
- embedVersionRange :: VersionRangeF VersionRange -> VersionRange
- cataVersionRange :: (VersionRangeF a -> a) -> VersionRange -> a
- projectVersionRange :: VersionRange -> VersionRangeF VersionRange
- majorBoundVersion :: Version -> VersionRange
- withinVersion :: Version -> VersionRange
- intersectVersionRanges :: VersionRange -> VersionRange -> VersionRange
- unionVersionRanges :: VersionRange -> VersionRange -> VersionRange
- orEarlierVersion :: Version -> VersionRange
- earlierVersion :: Version -> VersionRange
- orLaterVersion :: Version -> VersionRange
- laterVersion :: Version -> VersionRange
- notThisVersion :: Version -> VersionRange
- thisVersion :: Version -> VersionRange
- noVersion :: VersionRange
- anyVersion :: VersionRange
- data VersionRange
- = AnyVersion
- | ThisVersion Version
- | LaterVersion Version
- | OrLaterVersion Version
- | EarlierVersion Version
- | OrEarlierVersion Version
- | WildcardVersion Version
- | MajorBoundVersion Version
- | UnionVersionRanges VersionRange VersionRange
- | IntersectVersionRanges VersionRange VersionRange
- | VersionRangeParens VersionRange
- data VersionRangeF a
- showVersion :: Version -> String
- alterVersion :: ([Int] -> [Int]) -> Version -> Version
- nullVersion :: Version
- versionNumbers :: Version -> [Int]
- mkVersion' :: Version -> Version
- version0 :: Version
- mkVersion :: [Int] -> Version
- data Version
Documentation
defaultMain :: IO () Source #
A simple implementation of main
for a Cabal setup script. This is the
same as defaultMain
, with added support for building
libraries utilising runQ
*.
simpleUserHooks :: UserHooks Source #
Hooks that correspond to a plain instantiation of the "simple" build system.
defaultUserHooks :: UserHooks #
Basic autoconf UserHooks
:
postConf
runs./configure
, if present.- the pre-hooks
preBuild
,preClean
,preCopy
,preInst
,preReg
andpreUnreg
read additional build information from package.buildinfo
, if present.
Thus configure
can use local system information to generate
package.buildinfo
and possibly other files.
defaultMainWithHooksNoReadArgs :: UserHooks -> GenericPackageDescription -> [String] -> IO () #
A customizable version of defaultMainNoRead
that also takes the
command line arguments.
Since: 2.2.0.0
defaultMainWithHooksNoRead :: UserHooks -> GenericPackageDescription -> IO () #
A customizable version of defaultMainNoRead
.
defaultMainNoRead :: GenericPackageDescription -> IO () #
Like defaultMain
, but accepts the package description as input
rather than using IO to read it.
defaultMainWithHooksArgs :: UserHooks -> [String] -> IO () #
A customizable version of defaultMain
that also takes the command
line arguments.
defaultMainWithHooks :: UserHooks -> IO () #
A customizable version of defaultMain
.
defaultMainArgs :: [String] -> IO () #
A version of defaultMain
that is passed the command line
arguments, rather than getting them from the environment.
Empty UserHooks
which do nothing.
Hooks 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
UserHooks | |
Fields
|
knownProfDetailLevels :: [(String, [String], ProfDetailLevel)] #
profilingSupported :: Compiler -> Bool #
Does this compiler support profiling?
coverageSupported :: Compiler -> Bool #
Does this compiler support Haskell program coverage?
arResponseFilesSupported :: Compiler -> Bool #
Does this compiler's "ar" command supports response file arguments (i.e. @file-style arguments).
libraryDynDirSupported :: Compiler -> Bool #
Does this compiler support a package database entry with: "dynamic-library-dirs"?
backpackSupported :: Compiler -> Bool #
Does this compiler support Backpack?
unitIdSupported :: Compiler -> Bool #
Does this compiler support unit IDs?
packageKeySupported :: Compiler -> Bool #
Does this compiler support package keys?
unifiedIPIDRequired :: Compiler -> Bool #
Does this compiler have unified IPIDs (so no package keys)
renamingPackageFlagsSupported :: Compiler -> Bool #
Does this compiler support thinning/renaming on package flags?
reexportedModulesSupported :: Compiler -> Bool #
Does this compiler support reexported-modules?
parmakeSupported :: Compiler -> Bool #
Does this compiler support parallel --make mode?
extensionsToFlags :: Compiler -> [Extension] -> [Flag] #
For the given compiler, return the flags for the supported extensions.
unsupportedExtensions :: Compiler -> [Extension] -> [Extension] #
For the given compiler, return the extensions it does not support.
unsupportedLanguages :: Compiler -> [Language] -> [Language] #
absolutePackageDBPaths :: PackageDBStack -> NoCallStackIO PackageDBStack #
Make package paths absolute
registrationPackageDB :: PackageDBStack -> PackageDB #
Return the package that we should register into. This is the package db at the top of the stack.
compilerInfo :: Compiler -> CompilerInfo #
compilerCompatVersion :: CompilerFlavor -> Compiler -> Maybe Version #
Is this compiler compatible with the compiler flavour we're interested in, and if so what version does it claim to be compatible with.
For example this checks if the compiler is actually GHC-7.x or is another compiler that claims to be compatible with some GHC-7.x version.
case compilerCompatVersion GHC compiler of Just (Version (7:_)) -> ... _ -> ...
compilerCompatFlavor :: CompilerFlavor -> Compiler -> Bool #
Is this compiler compatible with the compiler flavour we're interested in?
For example this checks if the compiler is actually GHC or is another compiler that claims to be compatible with some version of GHC, e.g. GHCJS.
if compilerCompatFlavor GHC compiler then ... else ...
compilerVersion :: Compiler -> Version #
showCompilerIdWithAbi :: Compiler -> String #
showCompilerId :: Compiler -> String #
Constructors
Compiler | |
Fields
|
Instances
Eq Compiler | |
Read Compiler | |
Show Compiler | |
Generic Compiler | |
Binary Compiler | |
type Rep Compiler | |
type Rep Compiler = D1 (MetaData "Compiler" "Distribution.Simple.Compiler" "Cabal-2.2.0.0" False) (C1 (MetaCons "Compiler" PrefixI True) ((S1 (MetaSel (Just "compilerId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CompilerId) :*: (S1 (MetaSel (Just "compilerAbiTag") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 AbiTag) :*: S1 (MetaSel (Just "compilerCompat") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [CompilerId]))) :*: (S1 (MetaSel (Just "compilerLanguages") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(Language, Flag)]) :*: (S1 (MetaSel (Just "compilerExtensions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(Extension, Maybe Flag)]) :*: S1 (MetaSel (Just "compilerProperties") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map String String)))))) |
Some compilers have a notion of a database of available packages. For some there is just one global db of packages, other compilers support a per-user or an arbitrary db specified at some location in the file system. This can be used to build isloated environments of packages, for example to build a collection of related packages without installing them globally.
Constructors
GlobalPackageDB | |
UserPackageDB | |
SpecificPackageDB FilePath |
Instances
Eq PackageDB | |
Ord PackageDB | |
Read PackageDB | |
Show PackageDB | |
Generic PackageDB | |
Binary PackageDB | |
type Rep PackageDB | |
type Rep PackageDB = D1 (MetaData "PackageDB" "Distribution.Simple.Compiler" "Cabal-2.2.0.0" False) (C1 (MetaCons "GlobalPackageDB" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "UserPackageDB" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "SpecificPackageDB" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath)))) |
type PackageDBStack = [PackageDB] #
We typically get packages from several databases, and stack them together. This type lets us be explicit about that stacking. For example typical stacks include:
[GlobalPackageDB] [GlobalPackageDB, UserPackageDB] [GlobalPackageDB, SpecificPackageDB "package.conf.inplace"]
Note that the GlobalPackageDB
is invariably at the bottom since it
contains the rts, base and other special compiler-specific packages.
We are not restricted to using just the above combinations. In particular we can use several custom package dbs and the user package db together.
When it comes to writing, the top most (last) package is used.
data OptimisationLevel #
Some compilers support optimising. Some have different levels. For compilers that do not the level is just capped to the level they do support.
Constructors
NoOptimisation | |
NormalOptimisation | |
MaximumOptimisation |
Instances
data DebugInfoLevel #
Some compilers support emitting debug info. Some have different levels. For compilers that do not the level is just capped to the level they do support.
Constructors
NoDebugInfo | |
MinimalDebugInfo | |
NormalDebugInfo | |
MaximalDebugInfo |
Instances
data ProfDetailLevel #
Some compilers (notably GHC) support profiling and can instrument programs so the system can account costs to different functions. There are different levels of detail that can be used for this accounting. For compilers that do not support this notion or the particular detail levels, this is either ignored or just capped to some similar level they do support.
Constructors
ProfDetailNone | |
ProfDetailDefault | |
ProfDetailExportedFunctions | |
ProfDetailToplevelFunctions | |
ProfDetailAllFunctions | |
ProfDetailOther String |
Instances
defaultHookedPackageDesc :: IO (Maybe FilePath) #
Optional auxiliary package information file (pkgname.buildinfo
)
installedPackageId :: HasUnitId pkg => pkg -> UnitId #
Compatibility wrapper for Cabal pre-1.24.
packageVersion :: Package pkg => pkg -> Version #
packageName :: Package pkg => pkg -> PackageName #
mungedVersion' :: HasMungedPackageId munged => munged -> Version #
mungedName' :: HasMungedPackageId pkg => pkg -> MungedPackageName #
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.
Minimal complete definition
Methods
packageId :: pkg -> PackageIdentifier #
Instances
Package ReadyComponent | |
Methods packageId :: ReadyComponent -> PackageIdentifier # | |
Package InstalledPackageInfo | |
Methods | |
Package GenericPackageDescription | |
Methods packageId :: GenericPackageDescription -> PackageIdentifier # | |
Package PackageDescription | |
Methods | |
Package PackageIdentifier | |
Methods |
class HasMungedPackageId pkg where #
Minimal complete definition
Methods
mungedId :: pkg -> MungedPackageId #
Instances
HasMungedPackageId InstalledPackageInfo | |
Methods | |
HasMungedPackageId MungedPackageId | |
Methods |
class Package pkg => HasUnitId pkg where #
Packages that have an installed unit ID
Minimal complete definition
Methods
installedUnitId :: pkg -> UnitId #
Instances
HasUnitId ReadyComponent | |
Methods installedUnitId :: ReadyComponent -> UnitId # | |
HasUnitId InstalledPackageInfo | |
Methods |
class HasUnitId pkg => PackageInstalled pkg where #
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
.
Minimal complete definition
Methods
installedDepends :: pkg -> [UnitId] #
Instances
PackageInstalled InstalledPackageInfo | |
Methods installedDepends :: InstalledPackageInfo -> [UnitId] # |
simplifyDependency :: Dependency -> Dependency #
Simplify the VersionRange
expression in a Dependency
.
See simplifyVersionRange
.
depVerRange :: Dependency -> VersionRange #
depPkgName :: Dependency -> PackageName #
data Dependency #
Describes a dependency on a source package (API)
Constructors
Dependency PackageName VersionRange |
Instances
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
Module DefUnitId ModuleName |
Instances
Eq Module | |
Data Module | |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Module -> c Module # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Module # toConstr :: Module -> Constr # dataTypeOf :: Module -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Module) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Module) # gmapT :: (forall b. Data b => b -> b) -> Module -> Module # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Module -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Module -> r # gmapQ :: (forall d. Data d => d -> u) -> Module -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Module -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Module -> m Module # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Module -> m Module # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Module -> m Module # | |
Ord Module | |
Read Module | |
Show Module | |
Generic Module | |
Text Module | |
Parsec Module | |
Methods parsec :: CabalParsing m => m Module # | |
Pretty Module | |
Binary Module | |
NFData Module | |
type Rep Module | |
type Rep Module = D1 (MetaData "Module" "Distribution.Types.Module" "Cabal-2.2.0.0" False) (C1 (MetaCons "Module" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DefUnitId) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ModuleName))) |
unsafeMkDefUnitId :: UnitId -> DefUnitId #
getHSLibraryName :: UnitId -> String #
Returns library name prefixed with HS, suitable for filenames
mkLegacyUnitId :: PackageId -> UnitId #
Make an old-style UnitId from a package identifier. Assumed to be for the public library
newSimpleUnitId :: ComponentId -> UnitId #
Create a unit identity with no associated hash directly
from a ComponentId
.
unUnitId :: UnitId -> String #
If you need backwards compatibility, consider using display
instead, which is supported by all versions of Cabal.
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
unitIdHash
isNothing
. In the absence of Backpack,UnitId
is the same as aComponentId
. - An indefinite, Backpack library with holes. In this case,
unitIdHash
is stillNothing
, but in the install, there are only interfaces, no compiled objects. - An instantiated Backpack library with all the holes
filled in.
unitIdHash
is aJust
a 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.
Instances
Eq UnitId | |
Data UnitId | |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UnitId -> c UnitId # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UnitId # toConstr :: UnitId -> Constr # dataTypeOf :: UnitId -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UnitId) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UnitId) # gmapT :: (forall b. Data b => b -> b) -> UnitId -> UnitId # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UnitId -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UnitId -> r # gmapQ :: (forall d. Data d => d -> u) -> UnitId -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> UnitId -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UnitId -> m UnitId # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UnitId -> m UnitId # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UnitId -> m UnitId # | |
Ord UnitId | |
Read UnitId | |
Show UnitId | |
IsString UnitId | Since: 2.0.0.2 |
Methods fromString :: String -> UnitId # | |
Generic UnitId | |
Text UnitId | |
Parsec UnitId | The textual format for |
Methods parsec :: CabalParsing m => m UnitId # | |
Pretty UnitId | The textual format for |
Binary UnitId | |
NFData UnitId | |
type Rep UnitId | |
type InstalledPackageId = UnitId #
A UnitId
for a definite package. The DefUnitId
invariant says
that a UnitId
identified this way is definite; i.e., it has no
unfilled holes.
Instances
Eq DefUnitId | |
Data DefUnitId | |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DefUnitId -> c DefUnitId # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DefUnitId # toConstr :: DefUnitId -> Constr # dataTypeOf :: DefUnitId -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DefUnitId) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DefUnitId) # gmapT :: (forall b. Data b => b -> b) -> DefUnitId -> DefUnitId # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DefUnitId -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DefUnitId -> r # gmapQ :: (forall d. Data d => d -> u) -> DefUnitId -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> DefUnitId -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> DefUnitId -> m DefUnitId # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DefUnitId -> m DefUnitId # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DefUnitId -> m DefUnitId # | |
Ord DefUnitId | |
Read DefUnitId | |
Show DefUnitId | |
Generic DefUnitId | |
Text DefUnitId | |
Parsec DefUnitId | |
Methods parsec :: CabalParsing m => m DefUnitId # | |
Pretty DefUnitId | |
Binary DefUnitId | |
NFData DefUnitId | |
type Rep DefUnitId | |
type PackageId = PackageIdentifier #
Type alias so we can use the shorter name PackageId.
data PackageIdentifier #
The name and version of a package.
Constructors
PackageIdentifier | |
Fields
|
Instances
mkPackageName :: String -> PackageName #
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
Since: 2.0.0.2
unPackageName :: PackageName -> String #
Convert PackageName
to String
data PackageName #
A package name.
Use mkPackageName
and unPackageName
to convert from/to a
String
.
This type is opaque since Cabal-2.0
Since: 2.0.0.2
Instances
unknownCompilerInfo :: CompilerId -> AbiTag -> CompilerInfo #
Make a CompilerInfo of which only the known information is its CompilerId, its AbiTag and that it does not claim to be compatible with other compiler id's.
abiTagString :: AbiTag -> String #
defaultCompilerFlavor :: Maybe CompilerFlavor #
The default compiler flavour to pick when compiling stuff. This defaults to the compiler used to build the Cabal lib.
However if it's not a recognised compiler then it's Nothing
and the user
will have to specify which compiler they want.
parseCompilerFlavorCompat :: ReadP r CompilerFlavor #
Like classifyCompilerFlavor
but compatible with the old ReadS parser.
It is compatible in the sense that it accepts only the same strings,
eg GHC but not "ghc". However other strings get mapped to OtherCompiler
.
The point of this is that we do not allow extra valid values that would
upset older Cabal versions that had a stricter parser however we cope with
new values more gracefully so that we'll be able to introduce new value in
future without breaking things so much.
data CompilerFlavor #
Instances
data CompilerId #
Constructors
CompilerId CompilerFlavor Version |
Instances
data CompilerInfo #
Compiler information used for resolving configurations. Some fields can be set to Nothing to indicate that the information is unknown.
Constructors
CompilerInfo | |
Fields
|
Instances
classifyExtension :: String -> Extension #
deprecatedExtensions :: [(Extension, Maybe Extension)] #
Extensions that have been deprecated, possibly paired with another extension that replaces it.
classifyLanguage :: String -> Language #
knownLanguages :: [Language] #
This represents a Haskell language dialect.
Language Extension
s are interpreted relative to one of these base
languages.
Constructors
Haskell98 | The Haskell 98 language as defined by the Haskell 98 report. http://haskell.org/onlinereport/ |
Haskell2010 | The Haskell 2010 language as defined by the Haskell 2010 report. http://www.haskell.org/onlinereport/haskell2010 |
UnknownLanguage String | An unknown language, identified by its name. |
Instances
Eq Language | |
Data Language | |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Language -> c Language # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Language # toConstr :: Language -> Constr # dataTypeOf :: Language -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Language) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Language) # gmapT :: (forall b. Data b => b -> b) -> Language -> Language # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Language -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Language -> r # gmapQ :: (forall d. Data d => d -> u) -> Language -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Language -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Language -> m Language # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Language -> m Language # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Language -> m Language # | |
Read Language | |
Show Language | |
Generic Language | |
Text Language | |
Parsec Language | |
Methods parsec :: CabalParsing m => m Language # | |
Pretty Language | |
Binary Language | |
NFData Language | |
type Rep Language | |
type Rep Language = D1 (MetaData "Language" "Language.Haskell.Extension" "Cabal-2.2.0.0" False) (C1 (MetaCons "Haskell98" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "Haskell2010" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "UnknownLanguage" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)))) |
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 KnownExtension | Enable a known extension |
DisableExtension KnownExtension | Disable a known extension |
UnknownExtension String | An unknown extension, identified by the name of its |
Instances
data KnownExtension #
Constructors
OverlappingInstances | Allow overlapping class instances, provided there is a unique most specific instance for each use. |
UndecidableInstances | Ignore 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. |
IncoherentInstances | Implies |
DoRec | (deprecated) Deprecated in favour of Old description: Allow recursive bindings in |
RecursiveDo | Allow recursive bindings in |
ParallelListComp | Provide syntax for writing list comprehensions which iterate
over several lists together, like the |
MultiParamTypeClasses | Allow multiple parameters in a type class. |
MonomorphismRestriction | Enable the dreaded monomorphism restriction. |
FunctionalDependencies | Allow 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 Old description: Like |
RankNTypes | Allow a universally-quantified type to occur on the left of a function arrow. |
PolymorphicComponents | (deprecated) A synonym for Old description: Allow data constructors to have polymorphic
arguments. Unlike |
ExistentialQuantification | Allow existentially-quantified data constructors. |
ScopedTypeVariables | Cause a type variable in a signature, which has an explicit
|
PatternSignatures | Deprecated, use |
ImplicitParams | Enable implicit function parameters with dynamic scope. |
FlexibleContexts | Relax some restrictions on the form of the context of a type signature. |
FlexibleInstances | Relax some restrictions on the form of the context of an instance declaration. |
EmptyDataDecls | Allow data type declarations with no constructors. |
CPP | Run the C preprocessor on Haskell source code. |
KindSignatures | Allow an explicit kind signature giving the kind of types over which a type variable ranges. |
BangPatterns | Enable a form of pattern which forces evaluation before an
attempted match, and a form of strict |
TypeSynonymInstances | Allow type synonyms in instance heads. |
TemplateHaskell | Enable Template Haskell, a system for compile-time metaprogramming. |
ForeignFunctionInterface | Enable the Foreign Function Interface. In GHC, implements the standard Haskell 98 Foreign Function Interface Addendum, plus some GHC-specific extensions. |
Arrows | Enable arrow notation. |
Generics | (deprecated) Enable generic type classes, with default instances defined in terms of the algebraic structure of a type. |
ImplicitPrelude | Enable the implicit importing of the module Prelude. When disabled, when desugaring certain built-in syntax into ordinary identifiers, use whatever is in scope rather than the Prelude -- version. |
NamedFieldPuns | Enable syntax for implicitly binding local names corresponding
to the field names of a record. Puns bind specific names, unlike
|
PatternGuards | Enable a form of guard which matches a pattern and binds variables. |
GeneralizedNewtypeDeriving | Allow a type declared with |
ExtensibleRecords | Enable the "Trex" extensible records system. |
RestrictedTypeSynonyms | Enable type synonyms which are transparent in some definitions and opaque elsewhere, as a way of implementing abstract datatypes. |
HereDocuments | Enable an alternate syntax for string literals, with string templating. |
MagicHash | Allow the character |
TypeFamilies | Allow data types and type synonyms which are indexed by types, i.e. ad-hoc polymorphism for types. |
StandaloneDeriving | Allow a standalone declaration which invokes the type class
|
UnicodeSyntax | Allow certain Unicode characters to stand for certain ASCII character sequences, e.g. keywords and punctuation. |
UnliftedFFITypes | Allow the use of unboxed types as foreign types, e.g. in
|
InterruptibleFFI | Enable interruptible FFI. |
CApiFFI | Allow use of CAPI FFI calling convention ( |
LiberalTypeSynonyms | Defer validity checking of types until after expanding type synonyms, relaxing the constraints on how synonyms may be used. |
TypeOperators | Allow the name of a type constructor, type class, or type variable to be an infix operator. * https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XTypeOperators |
RecordWildCards | Enable syntax for implicitly binding local names corresponding
to the field names of a record. A wildcard binds all unmentioned
names, unlike |
RecordPuns | Deprecated, use |
DisambiguateRecordFields | Allow a record field name to be disambiguated by the type of the record it's in. |
TraditionalRecordSyntax | Enable traditional record syntax (as supported by Haskell 98) |
OverloadedStrings | Enable overloading of string literals using a type class, much like integer literals. |
GADTs | Enable generalized algebraic data types, in which type
variables may be instantiated on a per-constructor basis. Implies
|
GADTSyntax | Enable GADT syntax for declaring ordinary algebraic datatypes. |
MonoPatBinds | (deprecated) Has no effect. Old description: Make pattern bindings monomorphic. |
RelaxedPolyRec | Relax the requirements on mutually-recursive polymorphic functions. |
ExtendedDefaultRules | Allow default instantiation of polymorphic types in more situations. |
UnboxedTuples | Enable unboxed tuples. |
DeriveDataTypeable | |
DeriveGeneric | |
DefaultSignatures | Enable support for default signatures. |
InstanceSigs | Allow type signatures to be specified in instance declarations. |
ConstrainedClassMethods | Allow a class method's type to place additional constraints on a class type variable. |
PackageImports | Allow imports to be qualified by the package name the module is intended to be imported from, e.g. import "network" Network.Socket |
ImpredicativeTypes | (deprecated) Allow a type variable to be instantiated at a polymorphic type. |
NewQualifiedOperators | (deprecated) Change the syntax for qualified infix operators. |
PostfixOperators | Relax the interpretation of left operator sections to allow unary postfix operators. |
QuasiQuotes | Enable quasi-quotation, a mechanism for defining new concrete syntax for expressions and patterns. |
TransformListComp | Enable generalized list comprehensions, supporting operations such as sorting and grouping. |
MonadComprehensions | Enable monad comprehensions, which generalise the list comprehension syntax to work for any monad. |
ViewPatterns | Enable view patterns, which match a value by applying a function and matching on the result. |
XmlSyntax | Allow 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. |
RegularPatterns | Allow regular pattern matching over lists, as discussed in the paper "Regular Expression Patterns" by Niklas Broberg, Andreas Farre and Josef Svenningsson, from ICFP '04. |
TupleSections | Enable the use of tuple sections, e.g. |
GHCForeignImportPrim | Allow GHC primops, written in C--, to be imported into a Haskell file. |
NPlusKPatterns | Support for patterns of the form |
DoAndIfThenElse | Improve the layout rule when |
MultiWayIf | Enable support for multi-way |
LambdaCase | Enable support lambda- |
RebindableSyntax | Makes much of the Haskell sugar be desugared into calls to the function with a particular name that is in scope. |
ExplicitForAll | Make |
DatatypeContexts | Allow contexts to be put on datatypes, e.g. the |
MonoLocalBinds | Local ( |
DeriveFunctor | Enable |
DeriveTraversable | Enable |
DeriveFoldable | Enable |
NondecreasingIndentation | Enable non-decreasing indentation for |
SafeImports | Allow 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.Socket |
Safe | Compile a module in the Safe, Safe Haskell mode -- a restricted form of the Haskell language to ensure type safety. |
Trustworthy | Compile 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. |
Unsafe | Compile a module in the Unsafe, Safe Haskell mode so that modules compiled using Safe, Safe Haskell mode can't import it. |
ConstraintKinds | Allow type classimplicit parameterequality constraints to be
used as types with the special kind constraint. Also generalise
the |
PolyKinds | Enable kind polymorphism. |
DataKinds | Enable datatype promotion. |
ParallelArrays | Enable parallel arrays syntax ( |
RoleAnnotations | Enable explicit role annotations, like in ( |
OverloadedLists | Enable overloading of list literals, arithmetic sequences and
list patterns using the |
EmptyCase | Enable case expressions that have no alternatives. Also applies to lambda-case expressions if they are enabled. |
AutoDeriveTypeable | (deprecated) Deprecated in favour of Old description: Triggers the generation of derived |
NegativeLiterals | Desugars negative literals directly (without using negate). |
BinaryLiterals | Allow the use of binary integer literal syntax (e.g. |
NumDecimals | Allow the use of floating literal syntax for all instances of |
NullaryTypeClasses | Enable support for type classes with no type parameter. |
ExplicitNamespaces | Enable explicit namespaces in module import/export lists. |
AllowAmbiguousTypes | Allow the user to write ambiguous types, and the type inference engine to infer them. |
JavaScriptFFI | Enable |
PatternSynonyms | Allow giving names to and abstracting over patterns. |
PartialTypeSignatures | Allow anonymous placeholders (underscore) inside type signatures. The type inference engine will generate a message describing the type inferred at the hole's location. |
NamedWildCards | Allow named placeholders written with a leading underscore inside type signatures. Wildcards with the same name unify to the same type. |
DeriveAnyClass | Enable |
DeriveLift | Enable |
StaticPointers | Enable support for 'static pointers' (and the |
StrictData | Switches data type declarations to be strict by default (as if
they had a bang using |
Strict | Switches all pattern bindings to be strict by default (as if
they had a bang using |
ApplicativeDo | Allows |
DuplicateRecordFields | Allow records to use duplicated field labels for accessors. |
TypeApplications | Enable explicit type applications with the syntax |
TypeInType | Dissolve 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. |
UndecidableSuperClasses | Allow recursive (and therefore undecideable) super-class relationships. |
MonadFailDesugaring | A temporary extension to help library authors check if their code will compile with the new planned desugaring of fail. |
TemplateHaskellQuotes | A subset of |
OverloadedLabels | Allows use of the |
TypeFamilyDependencies | Allow functional dependency annotations on type families to declare them as injective. |
DerivingStrategies | Allow multiple |
UnboxedSums | Enable the use of unboxed sum syntax. |
HexFloatLiterals | Allow use of hexadecimal literal notation for floating-point values. |
Instances
Bounded KnownExtension | |
Enum KnownExtension | |
Methods succ :: KnownExtension -> KnownExtension # pred :: KnownExtension -> KnownExtension # toEnum :: Int -> KnownExtension # fromEnum :: KnownExtension -> Int # enumFrom :: KnownExtension -> [KnownExtension] # enumFromThen :: KnownExtension -> KnownExtension -> [KnownExtension] # enumFromTo :: KnownExtension -> KnownExtension -> [KnownExtension] # enumFromThenTo :: KnownExtension -> KnownExtension -> KnownExtension -> [KnownExtension] # | |
Eq KnownExtension | |
Methods (==) :: KnownExtension -> KnownExtension -> Bool # (/=) :: KnownExtension -> KnownExtension -> Bool # | |
Data KnownExtension | |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> KnownExtension -> c KnownExtension # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c KnownExtension # toConstr :: KnownExtension -> Constr # dataTypeOf :: KnownExtension -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c KnownExtension) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KnownExtension) # gmapT :: (forall b. Data b => b -> b) -> KnownExtension -> KnownExtension # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> KnownExtension -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> KnownExtension -> r # gmapQ :: (forall d. Data d => d -> u) -> KnownExtension -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> KnownExtension -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> KnownExtension -> m KnownExtension # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> KnownExtension -> m KnownExtension # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> KnownExtension -> m KnownExtension # | |
Ord KnownExtension | |
Methods compare :: KnownExtension -> KnownExtension -> Ordering # (<) :: KnownExtension -> KnownExtension -> Bool # (<=) :: KnownExtension -> KnownExtension -> Bool # (>) :: KnownExtension -> KnownExtension -> Bool # (>=) :: KnownExtension -> KnownExtension -> Bool # max :: KnownExtension -> KnownExtension -> KnownExtension # min :: KnownExtension -> KnownExtension -> KnownExtension # | |
Read KnownExtension | |
Methods readsPrec :: Int -> ReadS KnownExtension # readList :: ReadS [KnownExtension] # | |
Show KnownExtension | |
Methods showsPrec :: Int -> KnownExtension -> ShowS # show :: KnownExtension -> String # showList :: [KnownExtension] -> ShowS # | |
Generic KnownExtension | |
Associated Types type Rep KnownExtension :: * -> * # Methods from :: KnownExtension -> Rep KnownExtension x # to :: Rep KnownExtension x -> KnownExtension # | |
Text KnownExtension | |
Pretty KnownExtension | |
Methods pretty :: KnownExtension -> Doc # | |
Binary KnownExtension | |
Methods put :: KnownExtension -> Put # get :: Get KnownExtension # putList :: [KnownExtension] -> Put # | |
NFData KnownExtension | |
Methods rnf :: KnownExtension -> () # | |
type Rep KnownExtension | |
type Rep KnownExtension = D1 (MetaData "KnownExtension" "Language.Haskell.Extension" "Cabal-2.2.0.0" 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 "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 "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 "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 "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 "UnboxedSums" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "HexFloatLiterals" PrefixI False) (U1 :: * -> *)))))))) |
licenseFromSPDX :: License -> License #
This is lossy conversion. We try our best.
>>>
licenseFromSPDX . licenseToSPDX $ BSD3
BSD3
>>>
licenseFromSPDX . licenseToSPDX $ GPL (Just (mkVersion [3]))
GPL (Just (mkVersion [3]))
>>>
licenseFromSPDX . licenseToSPDX $ PublicDomain
UnknownLicense "LicenseRefPublicDomain"
>>>
licenseFromSPDX $ SPDX.License $ SPDX.simpleLicenseExpression SPDX.EUPL_1_1
UnknownLicense "EUPL-1.1"
>>>
licenseFromSPDX . licenseToSPDX $ AllRightsReserved
AllRightsReserved
>>>
licenseFromSPDX <$> simpleParsec "BSD-3-Clause OR GPL-3.0-only"
Just (UnknownLicense "BSD3ClauseORGPL30only")
Since: 2.2.0.0
licenseToSPDX :: License -> License #
Convert old License
to SPDX License
.
Non-SPDX licenses are converted to LicenseRef
.
Since: 2.2.0.0
knownLicenses :: [License] #
The list of all currently recognised licenses.
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. |
BSD2 | |
BSD3 | |
BSD4 | 4-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. |
MIT | |
ISC | |
MPL Version | |
Apache (Maybe Version) | |
PublicDomain | The 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. |
AllRightsReserved | Explicitly 'All Rights Reserved', eg for proprietary software. The package may not be legally modified or redistributed by anyone but the rightsholder. |
UnspecifiedLicense | No license specified which legally defaults to 'All Rights Reserved'. The package may not be legally modified or redistributed by anyone but the rightsholder. |
OtherLicense | Any other software license. |
UnknownLicense String | Indicates an erroneous license name. |
Instances
Arguments
:: a |
|
-> (Version -> a) | "== v" |
-> (Version -> a) | "> v" |
-> (Version -> a) | "< v" |
-> (Version -> a) | ">= v" |
-> (Version -> a) | "<= v" |
-> (Version -> Version -> a) |
|
-> (Version -> Version -> a) |
|
-> (a -> a -> a) |
|
-> (a -> a -> a) |
|
-> (a -> a) |
|
-> VersionRange | |
-> a |
An extended variant of foldVersionRange
that also provides a view of the
expression in which the syntactic sugar ">= v"
, "<= v"
and "==
v.*"
is presented explicitly rather than in terms of the other basic
syntax.
betweenVersionsInclusive :: Version -> Version -> VersionRange #
removeUpperBound :: VersionRange -> VersionRange #
Given a version range, remove the highest upper bound. Example: (>= 1 && <
3) || (>= 4 && < 5)
is converted to (>= 1 && || (= 4)
.
invertVersionRange :: VersionRange -> VersionRange #
The inverse of a version range
withinRange v' (invertVersionRange vr) = not (withinRange v' vr)
differenceVersionRanges :: VersionRange -> VersionRange -> VersionRange #
The difference of two version ranges
withinRange v' (differenceVersionRanges vr1 vr2) = withinRange v' vr1 && not (withinRange v' vr2)
Since: 1.24.1.0
simplifyVersionRange :: VersionRange -> VersionRange #
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'
isSpecificVersion :: VersionRange -> Maybe Version #
Is this version range in fact just a specific version?
For example the version range ">= 3 && <= 3"
contains only the version
3
.
isNoVersion :: VersionRange -> Bool #
This 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)
isAnyVersion :: VersionRange -> Bool #
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)
ABI Hashes
Use mkAbiHash
and unAbiHash
to convert from/to a
String
.
This type is opaque since Cabal-2.0
Since: 2.0.0.2
unComponentId :: ComponentId -> String #
Convert ComponentId
to String
Since: 2.0.0.2
mkComponentId :: String -> ComponentId #
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
Since: 2.0.0.2
data ComponentId #
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
Since: 2.0.0.2
Instances
mkPkgconfigName :: String -> PkgconfigName #
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
Since: 2.0.0.2
unPkgconfigName :: PkgconfigName -> String #
Convert PkgconfigName
to String
Since: 2.0.0.2
data PkgconfigName #
A pkg-config library name
This is parsed as any valid argument to the pkg-config utility.
Since: 2.0.0.2
Instances
fromVersionIntervals :: VersionIntervals -> VersionRange #
Convert a VersionIntervals
value back into a VersionRange
expression
representing the version intervals.
toVersionIntervals :: VersionRange -> VersionIntervals #
Convert a VersionRange
to a sequence of version intervals.
withinIntervals :: Version -> VersionIntervals -> Bool #
Test if a version falls within the version intervals.
It exists mostly for completeness and testing. It satisfies the following properties:
withinIntervals v (toVersionIntervals vr) = withinRange v vr withinIntervals v ivs = withinRange v (fromVersionIntervals ivs)
mkVersionIntervals :: [VersionInterval] -> VersionIntervals #
Directly construct a VersionIntervals
from a list of intervals.
In Cabal-2.2
the Maybe
is dropped from the result type.
versionIntervals :: VersionIntervals -> [VersionInterval] #
Inspect the list of version intervals.
asVersionIntervals :: VersionRange -> [VersionInterval] #
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 && 2
).
Other checks are trivial to implement using this view. For example:
isNoVersion vr | [] <- asVersionIntervals vr = True | otherwise = False
isSpecificVersion vr | [(LowerBound v InclusiveBound ,UpperBound v' InclusiveBound)] <- asVersionIntervals vr , v == v' = Just v | otherwise = Nothing
data VersionIntervals #
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 VersionRange
s. 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.
Instances
Eq VersionIntervals | |
Methods (==) :: VersionIntervals -> VersionIntervals -> Bool # (/=) :: VersionIntervals -> VersionIntervals -> Bool # | |
Show VersionIntervals | |
Methods showsPrec :: Int -> VersionIntervals -> ShowS # show :: VersionIntervals -> String # showList :: [VersionIntervals] -> ShowS # |
type VersionInterval = (LowerBound, UpperBound) #
data LowerBound #
Constructors
LowerBound Version !Bound |
Instances
Eq LowerBound | |
Ord LowerBound | |
Methods compare :: LowerBound -> LowerBound -> Ordering # (<) :: LowerBound -> LowerBound -> Bool # (<=) :: LowerBound -> LowerBound -> Bool # (>) :: LowerBound -> LowerBound -> Bool # (>=) :: LowerBound -> LowerBound -> Bool # max :: LowerBound -> LowerBound -> LowerBound # min :: LowerBound -> LowerBound -> LowerBound # | |
Show LowerBound | |
Methods showsPrec :: Int -> LowerBound -> ShowS # show :: LowerBound -> String # showList :: [LowerBound] -> ShowS # |
data UpperBound #
Constructors
NoUpperBound | |
UpperBound Version !Bound |
Instances
Eq UpperBound | |
Ord UpperBound | |
Methods compare :: UpperBound -> UpperBound -> Ordering # (<) :: UpperBound -> UpperBound -> Bool # (<=) :: UpperBound -> UpperBound -> Bool # (>) :: UpperBound -> UpperBound -> Bool # (>=) :: UpperBound -> UpperBound -> Bool # max :: UpperBound -> UpperBound -> UpperBound # min :: UpperBound -> UpperBound -> UpperBound # | |
Show UpperBound | |
Methods showsPrec :: Int -> UpperBound -> ShowS # show :: UpperBound -> String # showList :: [UpperBound] -> ShowS # |
Constructors
ExclusiveBound | |
InclusiveBound |
hasLowerBound :: VersionRange -> Bool #
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.
Since: 1.24.0.0
hasUpperBound :: VersionRange -> Bool #
Does the version range have an upper bound?
Since: 1.24.0.0
majorUpperBound :: Version -> Version #
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
Since: 2.2
wildcardUpperBound :: Version -> Version #
Since: 2.2
withinRange :: Version -> VersionRange -> Bool #
Does this version fall within the given range?
This is the evaluation function for the VersionRange
type.
stripParensVersionRange :: VersionRange -> VersionRange #
Remove VersionRangeParens
constructors.
Since: 2.2
normaliseVersionRange :: VersionRange -> VersionRange #
Normalise VersionRange
.
In particular collapse (== v || > v)
into >= v
, and so on.
hyloVersionRange :: (VersionRangeF VersionRange -> VersionRange) -> (VersionRange -> VersionRangeF VersionRange) -> VersionRange -> VersionRange #
Refold VersionRange
Since: 2.2
Arguments
:: a |
|
-> (Version -> a) | "== v" |
-> (Version -> a) | "> v" |
-> (Version -> a) | "< v" |
-> (a -> a -> a) |
|
-> (a -> a -> a) |
|
-> 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
.
anaVersionRange :: (a -> VersionRangeF a) -> a -> VersionRange #
Unfold VersionRange
.
Since: 2.2
embedVersionRange :: VersionRangeF VersionRange -> VersionRange #
Since: 2.2
cataVersionRange :: (VersionRangeF a -> a) -> VersionRange -> a #
Fold VersionRange
.
Since: 2.2
projectVersionRange :: VersionRange -> VersionRangeF VersionRange #
Since: 2.2
majorBoundVersion :: Version -> VersionRange #
The 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
.
Since: 2.0.0.2
withinVersion :: Version -> VersionRange #
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' (laterVersion v) = v' >= v && v' < upper v where upper (Version lower t) = Version (init lower ++ [last lower + 1]) t
intersectVersionRanges :: VersionRange -> VersionRange -> VersionRange #
The version range vr1 && vr2
withinRange v' (intersectVersionRanges vr1 vr2) = withinRange v' vr1 && withinRange v' vr2
unionVersionRanges :: VersionRange -> VersionRange -> VersionRange #
The version range vr1 || vr2
withinRange v' (unionVersionRanges vr1 vr2) = withinRange v' vr1 || withinRange v' vr2
orEarlierVersion :: Version -> VersionRange #
The version range <= v
withinRange v' (orEarlierVersion v) = v' <= v
earlierVersion :: Version -> VersionRange #
The version range < v
withinRange v' (earlierVersion v) = v' < v
orLaterVersion :: Version -> VersionRange #
The version range >= v
withinRange v' (orLaterVersion v) = v' >= v
laterVersion :: Version -> VersionRange #
The version range > v
withinRange v' (laterVersion v) = v' > v
notThisVersion :: Version -> VersionRange #
The version range || v
withinRange v' (notThisVersion v) = v' /= v
thisVersion :: Version -> VersionRange #
The version range == v
withinRange v' (thisVersion v) = v' == v
The empty version range, that is a version range containing no versions.
This can be constructed using any unsatisfiable version range expression,
for example > 1 && < 1
.
withinRange v noVersion = False
The version range -any
. That is, a version range containing all
versions.
withinRange v anyVersion = True
data VersionRange #
Constructors
Instances
data VersionRangeF a #
F-Algebra of VersionRange
. See cataVersionRange
.
Since: 2.2
Constructors
Instances
showVersion :: Version -> String #
alterVersion :: ([Int] -> [Int]) -> Version -> Version #
Apply function to list of version number components
alterVersion f == mkVersion . f . versionNumbers
Since: 2.0.0.2
nullVersion :: Version #
Constant representing the special null Version
The nullVersion
compares (via Ord
) as less than every proper
Version
value.
Since: 2.0.0.2
versionNumbers :: Version -> [Int] #
mkVersion' :: Version -> Version #
Variant of Version
which converts a Data.Version Version
into Cabal's Version
type.
Since: 2.0.0.2
mkVersion :: [Int] -> Version #
Construct 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
.
Since: 2.0.0.2
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.
Since: 2.0.0.2
Instances
Eq Version | |
Data Version | |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Version -> c Version # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Version # toConstr :: Version -> Constr # dataTypeOf :: Version -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Version) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Version) # gmapT :: (forall b. Data b => b -> b) -> Version -> Version # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Version -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Version -> r # gmapQ :: (forall d. Data d => d -> u) -> Version -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Version -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Version -> m Version # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Version -> m Version # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Version -> m Version # | |
Ord Version | |
Read Version | |
Show Version | |
Generic Version | |
Text Version | |
Parsec Version | |
Methods parsec :: CabalParsing m => m Version # | |
Pretty Version | |
Binary Version | |
NFData Version | |
type Rep Version | |
type Rep Version = D1 (MetaData "Version" "Distribution.Types.Version" "Cabal-2.2.0.0" False) (C1 (MetaCons "PV0" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) SourceUnpack SourceStrict DecidedUnpack) (Rec0 Word64)) :+: C1 (MetaCons "PV1" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Int]))) |