Cabal-syntax-3.12.0.0: A library for working with .cabal files
CopyrightIsaac Jones 2003-2004
LicenseBSD3
Maintainercabal-devel@haskell.org
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Distribution.Compiler

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

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 Source #

Instances

Instances details
Parsec CompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

Pretty CompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

Structured CompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

Binary CompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

NFData CompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

Methods

rnf :: CompilerFlavor -> () Source #

Data CompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

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 :: forall r r'. (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 #

Generic CompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

Associated Types

type Rep CompilerFlavor 
Instance details

Defined in Distribution.Compiler

type Rep CompilerFlavor = D1 ('MetaData "CompilerFlavor" "Distribution.Compiler" "Cabal-syntax-3.12.0.0-a70a" 'False) (((C1 ('MetaCons "GHC" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "GHCJS" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NHC" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "YHC" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Hugs" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "HBC" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "Helium" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "JHC" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LHC" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "UHC" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Eta" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (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))))))
Read CompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

Show CompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

Eq CompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

Ord CompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

Newtype (CompilerFlavor, VersionRange) TestedWith Source # 
Instance details

Defined in Distribution.FieldGrammar.Newtypes

type Rep CompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

type Rep CompilerFlavor = D1 ('MetaData "CompilerFlavor" "Distribution.Compiler" "Cabal-syntax-3.12.0.0-a70a" 'False) (((C1 ('MetaCons "GHC" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "GHCJS" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NHC" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "YHC" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Hugs" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "HBC" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "Helium" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "JHC" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LHC" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "UHC" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Eta" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (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 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.

Per compiler flavor

data PerCompilerFlavor v Source #

PerCompilerFlavor carries only info per GHC and GHCJS

Cabal parses only ghc-options and ghcjs-options, others are omitted.

Constructors

PerCompilerFlavor v v 

Instances

Instances details
Functor PerCompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

Foldable PerCompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

Methods

fold :: Monoid m => PerCompilerFlavor m -> m #

foldMap :: Monoid m => (a -> m) -> PerCompilerFlavor a -> m #

foldMap' :: Monoid m => (a -> m) -> PerCompilerFlavor a -> m #

foldr :: (a -> b -> b) -> b -> PerCompilerFlavor a -> b #

foldr' :: (a -> b -> b) -> b -> PerCompilerFlavor a -> b #

foldl :: (b -> a -> b) -> b -> PerCompilerFlavor a -> b #

foldl' :: (b -> a -> b) -> b -> PerCompilerFlavor a -> b #

foldr1 :: (a -> a -> a) -> PerCompilerFlavor a -> a #

foldl1 :: (a -> a -> a) -> PerCompilerFlavor a -> a #

toList :: PerCompilerFlavor a -> [a] #

null :: PerCompilerFlavor a -> Bool #

length :: PerCompilerFlavor a -> Int #

elem :: Eq a => a -> PerCompilerFlavor a -> Bool #

maximum :: Ord a => PerCompilerFlavor a -> a #

minimum :: Ord a => PerCompilerFlavor a -> a #

sum :: Num a => PerCompilerFlavor a -> a #

product :: Num a => PerCompilerFlavor a -> a #

Traversable PerCompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

Methods

traverse :: Applicative f => (a -> f b) -> PerCompilerFlavor a -> f (PerCompilerFlavor b) #

sequenceA :: Applicative f => PerCompilerFlavor (f a) -> f (PerCompilerFlavor a) #

mapM :: Monad m => (a -> m b) -> PerCompilerFlavor a -> m (PerCompilerFlavor b) #

sequence :: Monad m => PerCompilerFlavor (m a) -> m (PerCompilerFlavor a) #

Structured a => Structured (PerCompilerFlavor a) Source # 
Instance details

Defined in Distribution.Compiler

Binary a => Binary (PerCompilerFlavor a) Source # 
Instance details

Defined in Distribution.Compiler

NFData a => NFData (PerCompilerFlavor a) Source # 
Instance details

Defined in Distribution.Compiler

Methods

rnf :: PerCompilerFlavor a -> () Source #

(Semigroup a, Monoid a) => Monoid (PerCompilerFlavor a) Source # 
Instance details

Defined in Distribution.Compiler

Semigroup a => Semigroup (PerCompilerFlavor a) Source # 
Instance details

Defined in Distribution.Compiler

Data v => Data (PerCompilerFlavor v) Source # 
Instance details

Defined in Distribution.Compiler

Methods

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

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

toConstr :: PerCompilerFlavor v -> Constr #

dataTypeOf :: PerCompilerFlavor v -> DataType #

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

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

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

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

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

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

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

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

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

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

Generic (PerCompilerFlavor v) Source # 
Instance details

Defined in Distribution.Compiler

Associated Types

type Rep (PerCompilerFlavor v) 
Instance details

Defined in Distribution.Compiler

type Rep (PerCompilerFlavor v) = D1 ('MetaData "PerCompilerFlavor" "Distribution.Compiler" "Cabal-syntax-3.12.0.0-a70a" 'False) (C1 ('MetaCons "PerCompilerFlavor" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 v) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 v)))
Read v => Read (PerCompilerFlavor v) Source # 
Instance details

Defined in Distribution.Compiler

Show v => Show (PerCompilerFlavor v) Source # 
Instance details

Defined in Distribution.Compiler

Eq v => Eq (PerCompilerFlavor v) Source # 
Instance details

Defined in Distribution.Compiler

Ord v => Ord (PerCompilerFlavor v) Source # 
Instance details

Defined in Distribution.Compiler

type Rep (PerCompilerFlavor v) Source # 
Instance details

Defined in Distribution.Compiler

type Rep (PerCompilerFlavor v) = D1 ('MetaData "PerCompilerFlavor" "Distribution.Compiler" "Cabal-syntax-3.12.0.0-a70a" 'False) (C1 ('MetaCons "PerCompilerFlavor" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 v) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 v)))

Compiler id

data CompilerId Source #

Instances

Instances details
Parsec CompilerId Source # 
Instance details

Defined in Distribution.Compiler

Pretty CompilerId Source # 
Instance details

Defined in Distribution.Compiler

Structured CompilerId Source # 
Instance details

Defined in Distribution.Compiler

Binary CompilerId Source # 
Instance details

Defined in Distribution.Compiler

NFData CompilerId Source # 
Instance details

Defined in Distribution.Compiler

Methods

rnf :: CompilerId -> () Source #

Generic CompilerId Source # 
Instance details

Defined in Distribution.Compiler

Associated Types

type Rep CompilerId 
Instance details

Defined in Distribution.Compiler

type Rep CompilerId = D1 ('MetaData "CompilerId" "Distribution.Compiler" "Cabal-syntax-3.12.0.0-a70a" 'False) (C1 ('MetaCons "CompilerId" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CompilerFlavor) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)))
Read CompilerId Source # 
Instance details

Defined in Distribution.Compiler

Show CompilerId Source # 
Instance details

Defined in Distribution.Compiler

Eq CompilerId Source # 
Instance details

Defined in Distribution.Compiler

Ord CompilerId Source # 
Instance details

Defined in Distribution.Compiler

type Rep CompilerId Source # 
Instance details

Defined in Distribution.Compiler

type Rep CompilerId = D1 ('MetaData "CompilerId" "Distribution.Compiler" "Cabal-syntax-3.12.0.0-a70a" 'False) (C1 ('MetaCons "CompilerId" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CompilerFlavor) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)))

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.

Constructors

CompilerInfo 

Fields

Instances

Instances details
Binary CompilerInfo Source # 
Instance details

Defined in Distribution.Compiler

Generic CompilerInfo Source # 
Instance details

Defined in Distribution.Compiler

Associated Types

type Rep CompilerInfo 
Instance details

Defined in Distribution.Compiler

type Rep CompilerInfo = D1 ('MetaData "CompilerInfo" "Distribution.Compiler" "Cabal-syntax-3.12.0.0-a70a" '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]))))))
Read CompilerInfo Source # 
Instance details

Defined in Distribution.Compiler

Show CompilerInfo Source # 
Instance details

Defined in Distribution.Compiler

type Rep CompilerInfo Source # 
Instance details

Defined in Distribution.Compiler

type Rep CompilerInfo = D1 ('MetaData "CompilerInfo" "Distribution.Compiler" "Cabal-syntax-3.12.0.0-a70a" '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 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 #

Constructors

NoAbiTag 
AbiTag String 

Instances

Instances details
Parsec AbiTag Source # 
Instance details

Defined in Distribution.Compiler

Methods

parsec :: CabalParsing m => m AbiTag Source #

Pretty AbiTag Source # 
Instance details

Defined in Distribution.Compiler

Structured AbiTag Source # 
Instance details

Defined in Distribution.Compiler

Binary AbiTag Source # 
Instance details

Defined in Distribution.Compiler

Generic AbiTag Source # 
Instance details

Defined in Distribution.Compiler

Associated Types

type Rep AbiTag 
Instance details

Defined in Distribution.Compiler

type Rep AbiTag = D1 ('MetaData "AbiTag" "Distribution.Compiler" "Cabal-syntax-3.12.0.0-a70a" 'False) (C1 ('MetaCons "NoAbiTag" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AbiTag" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

Methods

from :: AbiTag -> Rep AbiTag x #

to :: Rep AbiTag x -> AbiTag #

Read AbiTag Source # 
Instance details

Defined in Distribution.Compiler

Show AbiTag Source # 
Instance details

Defined in Distribution.Compiler

Eq AbiTag Source # 
Instance details

Defined in Distribution.Compiler

Methods

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

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

type Rep AbiTag Source # 
Instance details

Defined in Distribution.Compiler

type Rep AbiTag = D1 ('MetaData "AbiTag" "Distribution.Compiler" "Cabal-syntax-3.12.0.0-a70a" 'False) (C1 ('MetaCons "NoAbiTag" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AbiTag" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))