Copyright | Isaac Jones 2003-2004 |
---|---|
License | BSD3 |
Maintainer | cabal-devel@haskell.org |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- data CompilerFlavor
- buildCompilerId :: CompilerId
- buildCompilerFlavor :: CompilerFlavor
- defaultCompilerFlavor :: Maybe CompilerFlavor
- classifyCompilerFlavor :: String -> CompilerFlavor
- knownCompilerFlavors :: [CompilerFlavor]
- data PerCompilerFlavor v = PerCompilerFlavor v v
- perCompilerFlavorToList :: PerCompilerFlavor v -> [(CompilerFlavor, v)]
- data CompilerId = CompilerId CompilerFlavor Version
- data CompilerInfo = CompilerInfo {}
- unknownCompilerInfo :: CompilerId -> AbiTag -> CompilerInfo
- data AbiTag
- abiTagString :: AbiTag -> String
Compiler flavor
data CompilerFlavor Source #
Constructors
GHC | |
GHCJS | |
NHC | |
YHC | |
Hugs | |
HBC | |
Helium | |
JHC | |
LHC | |
UHC | |
Eta | |
HaskellSuite String | |
OtherCompiler String |
Instances
Parsec CompilerFlavor Source # | |
Defined in Distribution.Compiler Methods parsec :: CabalParsing m => m CompilerFlavor Source # | |
Pretty CompilerFlavor Source # | |
Defined in Distribution.Compiler Methods pretty :: CompilerFlavor -> Doc Source # prettyVersioned :: CabalSpecVersion -> CompilerFlavor -> Doc Source # | |
Structured CompilerFlavor Source # | |
Defined in Distribution.Compiler Methods structure :: Proxy CompilerFlavor -> Structure Source # structureHash' :: Tagged CompilerFlavor MD5 | |
Data CompilerFlavor Source # | |
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 # | |
Defined in Distribution.Compiler Associated Types type Rep CompilerFlavor :: Type -> Type | |
Read CompilerFlavor Source # | |
Defined in Distribution.Compiler Methods readsPrec :: Int -> ReadS CompilerFlavor # readList :: ReadS [CompilerFlavor] # readPrec :: ReadPrec CompilerFlavor readListPrec :: ReadPrec [CompilerFlavor] | |
Show CompilerFlavor Source # | |
Defined in Distribution.Compiler Methods showsPrec :: Int -> CompilerFlavor -> ShowS # show :: CompilerFlavor -> String # showList :: [CompilerFlavor] -> ShowS # | |
Binary CompilerFlavor Source # | |
Defined in Distribution.Compiler Methods put :: CompilerFlavor -> Put # get :: Get CompilerFlavor # putList :: [CompilerFlavor] -> Put # | |
NFData CompilerFlavor Source # | |
Defined in Distribution.Compiler Methods rnf :: CompilerFlavor -> () # | |
Eq CompilerFlavor Source # | |
Defined in Distribution.Compiler Methods (==) :: CompilerFlavor -> CompilerFlavor -> Bool # (/=) :: CompilerFlavor -> CompilerFlavor -> Bool # | |
Ord CompilerFlavor Source # | |
Defined in Distribution.Compiler Methods compare :: CompilerFlavor -> CompilerFlavor -> Ordering # (<) :: CompilerFlavor -> CompilerFlavor -> Bool # (<=) :: CompilerFlavor -> CompilerFlavor -> Bool # (>) :: CompilerFlavor -> CompilerFlavor -> Bool # (>=) :: CompilerFlavor -> CompilerFlavor -> Bool # max :: CompilerFlavor -> CompilerFlavor -> CompilerFlavor # min :: CompilerFlavor -> CompilerFlavor -> CompilerFlavor # | |
Newtype (CompilerFlavor, VersionRange) TestedWith Source # | |
Defined in Distribution.FieldGrammar.Newtypes Methods pack :: (CompilerFlavor, VersionRange) -> TestedWith Source # unpack :: TestedWith -> (CompilerFlavor, VersionRange) Source # | |
type Rep CompilerFlavor Source # | |
Defined in Distribution.Compiler type Rep CompilerFlavor = D1 ('MetaData "CompilerFlavor" "Distribution.Compiler" "Cabal-syntax-3.13.0.0-inplace" '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
perCompilerFlavorToList :: PerCompilerFlavor v -> [(CompilerFlavor, v)] Source #
Compiler id
data CompilerId Source #
Constructors
CompilerId CompilerFlavor Version |
Instances
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
Generic CompilerInfo Source # | |
Defined in Distribution.Compiler Associated Types type Rep CompilerInfo :: Type -> Type | |
Read CompilerInfo Source # | |
Defined in Distribution.Compiler Methods readsPrec :: Int -> ReadS CompilerInfo # readList :: ReadS [CompilerInfo] # readPrec :: ReadPrec CompilerInfo readListPrec :: ReadPrec [CompilerInfo] | |
Show CompilerInfo Source # | |
Defined in Distribution.Compiler Methods showsPrec :: Int -> CompilerInfo -> ShowS # show :: CompilerInfo -> String # showList :: [CompilerInfo] -> ShowS # | |
Binary CompilerInfo Source # | |
Defined in Distribution.Compiler | |
type Rep CompilerInfo Source # | |
Defined in Distribution.Compiler type Rep CompilerInfo = D1 ('MetaData "CompilerInfo" "Distribution.Compiler" "Cabal-syntax-3.13.0.0-inplace" '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.
Instances
Parsec AbiTag Source # | |
Defined in Distribution.Compiler Methods parsec :: CabalParsing m => m AbiTag Source # | |
Pretty AbiTag Source # | |
Defined in Distribution.Compiler Methods pretty :: AbiTag -> Doc Source # prettyVersioned :: CabalSpecVersion -> AbiTag -> Doc Source # | |
Structured AbiTag Source # | |
Defined in Distribution.Compiler | |
Generic AbiTag Source # | |
Read AbiTag Source # | |
Show AbiTag Source # | |
Binary AbiTag Source # | |
Eq AbiTag Source # | |
type Rep AbiTag Source # | |
Defined in Distribution.Compiler type Rep AbiTag = D1 ('MetaData "AbiTag" "Distribution.Compiler" "Cabal-syntax-3.13.0.0-inplace" 'False) (C1 ('MetaCons "NoAbiTag" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AbiTag" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) |
abiTagString :: AbiTag -> String Source #