Cabal-2.2.0.1: A framework for packaging Haskell software

CopyrightIsaac Jones 2003-2004
LicenseBSD3
Maintainercabal-devel@haskell.org
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Distribution.Compiler

Contents

Description

This has an enumeration of the various compilers that Cabal knows about. It also specifies the default compiler. Sadly you'll often see code that does case analysis on this compiler flavour enumeration like:

case compilerFlavor comp of
  GHC -> GHC.getInstalledPackages verbosity packageDb progdb
  JHC -> JHC.getInstalledPackages verbosity packageDb progdb

Obviously it would be better to use the proper Compiler abstraction because that would keep all the compiler-specific code together. Unfortunately we cannot make this change yet without breaking the UserHooks api, which would break all custom Setup.hs files, so for the moment we just have to live with this deficiency. If you're interested, see ticket #57.

Synopsis

Compiler flavor

data CompilerFlavor #

Instances
Eq CompilerFlavor # 
Instance details
Data CompilerFlavor # 
Instance details

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CompilerFlavor -> c CompilerFlavor #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CompilerFlavor #

toConstr :: CompilerFlavor -> Constr #

dataTypeOf :: CompilerFlavor -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CompilerFlavor) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CompilerFlavor) #

gmapT :: (forall b. Data b => b -> b) -> CompilerFlavor -> CompilerFlavor #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CompilerFlavor -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CompilerFlavor -> r #

gmapQ :: (forall d. Data d => d -> u) -> CompilerFlavor -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CompilerFlavor -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CompilerFlavor -> m CompilerFlavor #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CompilerFlavor -> m CompilerFlavor #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CompilerFlavor -> m CompilerFlavor #

Ord CompilerFlavor # 
Instance details
Read CompilerFlavor # 
Instance details
Show CompilerFlavor # 
Instance details
Generic CompilerFlavor # 
Instance details

Associated Types

type Rep CompilerFlavor :: * -> * #

Binary CompilerFlavor # 
Instance details
NFData CompilerFlavor # 
Instance details

Methods

rnf :: CompilerFlavor -> () #

Pretty CompilerFlavor # 
Instance details

Methods

pretty :: CompilerFlavor -> Doc #

Parsec CompilerFlavor # 
Instance details
Text CompilerFlavor # 
Instance details
Newtype TestedWith (CompilerFlavor, VersionRange) # 
Instance details
type Rep CompilerFlavor # 
Instance details
type Rep CompilerFlavor = D1 (MetaData "CompilerFlavor" "Distribution.Compiler" "Cabal-2.2.0.1-JS0vobxWxH7sbYKd0omMO" False) (((C1 (MetaCons "GHC" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "GHCJS" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "NHC" PrefixI False) (U1 :: * -> *))) :+: (C1 (MetaCons "YHC" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "Hugs" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "HBC" PrefixI False) (U1 :: * -> *)))) :+: ((C1 (MetaCons "Helium" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "JHC" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "LHC" PrefixI False) (U1 :: * -> *))) :+: (C1 (MetaCons "UHC" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "HaskellSuite" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) :+: C1 (MetaCons "OtherCompiler" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 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.

Compiler id

data CompilerId #

Instances
Eq CompilerId # 
Instance details
Ord CompilerId # 
Instance details
Read CompilerId # 
Instance details
Show CompilerId # 
Instance details
Generic CompilerId # 
Instance details

Associated Types

type Rep CompilerId :: * -> * #

Binary CompilerId # 
Instance details
NFData CompilerId # 
Instance details

Methods

rnf :: CompilerId -> () #

Text CompilerId # 
Instance details
type Rep CompilerId # 
Instance details

Compiler info

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
Read CompilerInfo # 
Instance details
Show CompilerInfo # 
Instance details
Generic CompilerInfo # 
Instance details

Associated Types

type Rep CompilerInfo :: * -> * #

Binary CompilerInfo # 
Instance details
type Rep CompilerInfo # 
Instance details
type Rep CompilerInfo = D1 (MetaData "CompilerInfo" "Distribution.Compiler" "Cabal-2.2.0.1-JS0vobxWxH7sbYKd0omMO" False) (C1 (MetaCons "CompilerInfo" PrefixI True) ((S1 (MetaSel (Just "compilerInfoId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CompilerId) :*: S1 (MetaSel (Just "compilerInfoAbiTag") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 AbiTag)) :*: (S1 (MetaSel (Just "compilerInfoCompat") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe [CompilerId])) :*: (S1 (MetaSel (Just "compilerInfoLanguages") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe [Language])) :*: S1 (MetaSel (Just "compilerInfoExtensions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe [Extension]))))))

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.

data AbiTag #

Constructors

NoAbiTag 
AbiTag String 
Instances
Eq AbiTag # 
Instance details

Methods

(==) :: AbiTag -> AbiTag -> Bool #

(/=) :: AbiTag -> AbiTag -> Bool #

Read AbiTag # 
Instance details
Show AbiTag # 
Instance details
Generic AbiTag # 
Instance details

Associated Types

type Rep AbiTag :: * -> * #

Methods

from :: AbiTag -> Rep AbiTag x #

to :: Rep AbiTag x -> AbiTag #

Binary AbiTag # 
Instance details

Methods

put :: AbiTag -> Put #

get :: Get AbiTag #

putList :: [AbiTag] -> Put #

Text AbiTag # 
Instance details

Methods

disp :: AbiTag -> Doc #

parse :: ReadP r AbiTag #

type Rep AbiTag # 
Instance details
type Rep AbiTag = D1 (MetaData "AbiTag" "Distribution.Compiler" "Cabal-2.2.0.1-JS0vobxWxH7sbYKd0omMO" False) (C1 (MetaCons "NoAbiTag" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "AbiTag" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)))