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 |
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
- packageId :: pkg -> PackageIdentifier
- class HasMungedPackageId pkg where
- mungedId :: pkg -> MungedPackageId
- class Package pkg => HasUnitId pkg where
- installedUnitId :: pkg -> UnitId
- class HasUnitId pkg => PackageInstalled pkg where
- installedDepends :: pkg -> [UnitId]
- 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
- knownCompilerFlavors :: [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
- | BlockArguments
- | NumericUnderscores
- | QuantifiedConstraints
- | StarIsType
- 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: Cabal-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.
UserHooks | |
|
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 #
Compiler | |
|
Instances
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.
Instances
Eq PackageDB | |
Ord PackageDB | |
Defined in Distribution.Simple.Compiler | |
Read PackageDB | |
Show PackageDB | |
Generic PackageDB | |
Binary PackageDB | |
type Rep PackageDB | |
Defined in Distribution.Simple.Compiler type Rep PackageDB = D1 (MetaData "PackageDB" "Distribution.Simple.Compiler" "Cabal-2.4.1.0-9MZFDeNrcJI10bcroa6pq8" False) (C1 (MetaCons "GlobalPackageDB" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "UserPackageDB" PrefixI False) (U1 :: Type -> Type) :+: 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.
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.
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.
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.
packageId :: pkg -> PackageIdentifier #
Instances
Package ReadyComponent | |
Defined in Distribution.Backpack.ReadyComponent packageId :: ReadyComponent -> PackageIdentifier # | |
Package InstalledPackageInfo | |
Package GenericPackageDescription | |
Package PackageDescription | |
Defined in Distribution.Types.PackageDescription | |
Package PackageIdentifier | |
Defined in Distribution.Package |
class HasMungedPackageId pkg where #
mungedId :: pkg -> MungedPackageId #
Instances
HasMungedPackageId InstalledPackageInfo | |
Defined in Distribution.Types.InstalledPackageInfo | |
HasMungedPackageId MungedPackageId | |
Defined in Distribution.Package |
class Package pkg => HasUnitId pkg where #
Packages that have an installed unit ID
installedUnitId :: pkg -> UnitId #
Instances
HasUnitId ReadyComponent | |
Defined in Distribution.Backpack.ReadyComponent installedUnitId :: ReadyComponent -> UnitId # | |
HasUnitId InstalledPackageInfo | |
Defined in Distribution.Types.InstalledPackageInfo |
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
.
installedDepends :: pkg -> [UnitId] #
Instances
PackageInstalled InstalledPackageInfo | |
Defined in Distribution.Types.InstalledPackageInfo 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)
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
.
Instances
Eq Module | |
Data Module | |
Defined in Distribution.Types.Module 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 | |
Defined in Distribution.Types.Module parsec :: CabalParsing m => m Module # | |
Pretty Module | |
Defined in Distribution.Types.Module | |
NFData Module | |
Defined in Distribution.Types.Module | |
Binary Module | |
type Rep Module | |
Defined in Distribution.Types.Module type Rep Module = D1 (MetaData "Module" "Distribution.Types.Module" "Cabal-2.4.1.0-9MZFDeNrcJI10bcroa6pq8" 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 | |
Defined in Distribution.Types.UnitId 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: Cabal-2.0.0.2 |
Defined in Distribution.Types.UnitId fromString :: String -> UnitId # | |
Generic UnitId | |
Text UnitId | |
Parsec UnitId | The textual format for |
Defined in Distribution.Types.UnitId parsec :: CabalParsing m => m UnitId # | |
Pretty UnitId | The textual format for |
Defined in Distribution.Types.UnitId | |
NFData UnitId | |
Defined in Distribution.Types.UnitId | |
Binary UnitId | |
type Rep UnitId | |
Defined in Distribution.Types.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 | |
Defined in Distribution.Types.UnitId 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 | |
Defined in Distribution.Types.UnitId | |
Read DefUnitId | |
Show DefUnitId | |
Generic DefUnitId | |
Text DefUnitId | |
Parsec DefUnitId | |
Defined in Distribution.Types.UnitId parsec :: CabalParsing m => m DefUnitId # | |
Pretty DefUnitId | |
Defined in Distribution.Types.UnitId | |
NFData DefUnitId | |
Defined in Distribution.Types.UnitId | |
Binary DefUnitId | |
type Rep DefUnitId | |
Defined in Distribution.Types.UnitId |
type PackageId = PackageIdentifier #
Type alias so we can use the shorter name PackageId.
data PackageIdentifier #
The name and version of a package.
PackageIdentifier | |
|
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: Cabal-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: Cabal-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 #
Instances
data CompilerInfo #
Compiler information used for resolving configurations. Some fields can be set to Nothing to indicate that the information is unknown.
CompilerInfo | |
|
Instances
Instances
Eq AbiTag | |
Read AbiTag | |
Show AbiTag | |
Generic AbiTag | |
Text AbiTag | |
Binary AbiTag | |
type Rep AbiTag | |
Defined in Distribution.Compiler type Rep AbiTag = D1 (MetaData "AbiTag" "Distribution.Compiler" "Cabal-2.4.1.0-9MZFDeNrcJI10bcroa6pq8" False) (C1 (MetaCons "NoAbiTag" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "AbiTag" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))) |
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.
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 | |
Defined in Language.Haskell.Extension 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 | |
Defined in Language.Haskell.Extension parsec :: CabalParsing m => m Language # | |
Pretty Language | |
Defined in Language.Haskell.Extension | |
NFData Language | |
Defined in Language.Haskell.Extension | |
Binary Language | |
type Rep Language | |
Defined in Language.Haskell.Extension type Rep Language = D1 (MetaData "Language" "Language.Haskell.Extension" "Cabal-2.4.1.0-9MZFDeNrcJI10bcroa6pq8" False) (C1 (MetaCons "Haskell98" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Haskell2010" PrefixI False) (U1 :: Type -> Type) :+: 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.
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 #
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. |
BlockArguments | Allow |
NumericUnderscores | Allow use of underscores in numeric literals. |
QuantifiedConstraints | Allow |
StarIsType | Have |
Instances
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: Cabal-2.2.0.0
licenseToSPDX :: License -> License #
Convert old License
to SPDX License
.
Non-SPDX licenses are converted to LicenseRef
.
Since: Cabal-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.
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
:: 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: Cabal-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: Cabal-2.0.0.2
Instances
Eq AbiHash | |
Read AbiHash | |
Show AbiHash | |
IsString AbiHash | Since: Cabal-2.0.0.2 |
Defined in Distribution.Types.AbiHash fromString :: String -> AbiHash # | |
Generic AbiHash | |
Text AbiHash | |
Parsec AbiHash | |
Defined in Distribution.Types.AbiHash parsec :: CabalParsing m => m AbiHash # | |
Pretty AbiHash | |
Defined in Distribution.Types.AbiHash | |
NFData AbiHash | |
Defined in Distribution.Types.AbiHash | |
Binary AbiHash | |
type Rep AbiHash | |
Defined in Distribution.Types.AbiHash |
unComponentId :: ComponentId -> String #
Convert ComponentId
to String
Since: Cabal-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: Cabal-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: Cabal-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: Cabal-2.0.0.2
unPkgconfigName :: PkgconfigName -> String #
Convert PkgconfigName
to String
Since: Cabal-2.0.0.2
data PkgconfigName #
A pkg-config library name
This is parsed as any valid argument to the pkg-config utility.
Since: Cabal-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 | |
Defined in Distribution.Types.VersionInterval (==) :: VersionIntervals -> VersionIntervals -> Bool # (/=) :: VersionIntervals -> VersionIntervals -> Bool # | |
Show VersionIntervals | |
Defined in Distribution.Types.VersionInterval showsPrec :: Int -> VersionIntervals -> ShowS # show :: VersionIntervals -> String # showList :: [VersionIntervals] -> ShowS # |
type VersionInterval = (LowerBound, UpperBound) #
data LowerBound #
Instances
Eq LowerBound | |
Defined in Distribution.Types.VersionInterval (==) :: LowerBound -> LowerBound -> Bool # (/=) :: LowerBound -> LowerBound -> Bool # | |
Ord LowerBound | |
Defined in Distribution.Types.VersionInterval 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 | |
Defined in Distribution.Types.VersionInterval showsPrec :: Int -> LowerBound -> ShowS # show :: LowerBound -> String # showList :: [LowerBound] -> ShowS # |
data UpperBound #
Instances
Eq UpperBound | |
Defined in Distribution.Types.VersionInterval (==) :: UpperBound -> UpperBound -> Bool # (/=) :: UpperBound -> UpperBound -> Bool # | |
Ord UpperBound | |
Defined in Distribution.Types.VersionInterval 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 | |
Defined in Distribution.Types.VersionInterval showsPrec :: Int -> UpperBound -> ShowS # show :: UpperBound -> String # showList :: [UpperBound] -> ShowS # |
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: Cabal-1.24.0.0
hasUpperBound :: VersionRange -> Bool #
Does the version range have an upper bound?
Since: Cabal-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: Cabal-2.2
wildcardUpperBound :: Version -> Version #
Since: Cabal-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: Cabal-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: Cabal-2.2
:: 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: Cabal-2.2
embedVersionRange :: VersionRangeF VersionRange -> VersionRange #
Since: Cabal-2.2
cataVersionRange :: (VersionRangeF a -> a) -> VersionRange -> a #
Fold VersionRange
.
Since: Cabal-2.2
projectVersionRange :: VersionRange -> VersionRangeF VersionRange #
Since: Cabal-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: Cabal-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 #
Instances
data VersionRangeF a #
F-Algebra of VersionRange
. See cataVersionRange
.
Since: Cabal-2.2
Instances
showVersion :: Version -> String #
alterVersion :: ([Int] -> [Int]) -> Version -> Version #
Apply function to list of version number components
alterVersion f == mkVersion . f . versionNumbers
Since: Cabal-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: Cabal-2.0.0.2
versionNumbers :: Version -> [Int] #
mkVersion' :: Version -> Version #
Variant of mkVersion
which converts a Data.Version
Version
into Cabal's Version
type.
Since: Cabal-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: Cabal-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: Cabal-2.0.0.2