Cabal- A framework for packaging Haskell software

CopyrightIsaac Jones 2003-2004
Safe HaskellSafe




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 progconf
  JHC -> JHC.getInstalledPackages verbosity packageDb progconf

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.


Compiler flavor

data CompilerFlavor Source


Eq CompilerFlavor Source 
Data CompilerFlavor Source 


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 Source 
Read CompilerFlavor Source 
Show CompilerFlavor Source 
Generic CompilerFlavor Source 

Associated Types

type Rep CompilerFlavor :: * -> *

Binary CompilerFlavor Source 


put :: CompilerFlavor -> Put

get :: Get CompilerFlavor

Text CompilerFlavor Source 
type Rep CompilerFlavor Source 

defaultCompilerFlavor :: Maybe CompilerFlavor Source

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 Source

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

Compiler info

data CompilerInfo Source

Compiler information used for resolving configurations. Some fields can be set to Nothing to indicate that the information is unknown.




unknownCompilerInfo :: CompilerId -> AbiTag -> CompilerInfo Source

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 Source


AbiTag String