Copyright | Isaac Jones 2003-2004 |
---|---|
License | BSD3 |
Maintainer | cabal-devel@haskell.org |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
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 #
Instances
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.
Instances
Foldable PerCompilerFlavor Source # | |||||
Defined in Distribution.Compiler fold :: Monoid m => PerCompilerFlavor m -> m Source # foldMap :: Monoid m => (a -> m) -> PerCompilerFlavor a -> m Source # foldMap' :: Monoid m => (a -> m) -> PerCompilerFlavor a -> m Source # foldr :: (a -> b -> b) -> b -> PerCompilerFlavor a -> b Source # foldr' :: (a -> b -> b) -> b -> PerCompilerFlavor a -> b Source # foldl :: (b -> a -> b) -> b -> PerCompilerFlavor a -> b Source # foldl' :: (b -> a -> b) -> b -> PerCompilerFlavor a -> b Source # foldr1 :: (a -> a -> a) -> PerCompilerFlavor a -> a Source # foldl1 :: (a -> a -> a) -> PerCompilerFlavor a -> a Source # toList :: PerCompilerFlavor a -> [a] Source # null :: PerCompilerFlavor a -> Bool Source # length :: PerCompilerFlavor a -> Int Source # elem :: Eq a => a -> PerCompilerFlavor a -> Bool Source # maximum :: Ord a => PerCompilerFlavor a -> a Source # minimum :: Ord a => PerCompilerFlavor a -> a Source # sum :: Num a => PerCompilerFlavor a -> a Source # product :: Num a => PerCompilerFlavor a -> a Source # | |||||
Traversable PerCompilerFlavor Source # | |||||
Defined in Distribution.Compiler traverse :: Applicative f => (a -> f b) -> PerCompilerFlavor a -> f (PerCompilerFlavor b) Source # sequenceA :: Applicative f => PerCompilerFlavor (f a) -> f (PerCompilerFlavor a) Source # mapM :: Monad m => (a -> m b) -> PerCompilerFlavor a -> m (PerCompilerFlavor b) Source # sequence :: Monad m => PerCompilerFlavor (m a) -> m (PerCompilerFlavor a) Source # | |||||
Functor PerCompilerFlavor Source # | |||||
Defined in Distribution.Compiler fmap :: (a -> b) -> PerCompilerFlavor a -> PerCompilerFlavor b Source # (<$) :: a -> PerCompilerFlavor b -> PerCompilerFlavor a Source # | |||||
Structured a => Structured (PerCompilerFlavor a) Source # | |||||
Defined in Distribution.Compiler structure :: Proxy (PerCompilerFlavor a) -> Structure Source # structureHash' :: Tagged (PerCompilerFlavor a) MD5 | |||||
Data v => Data (PerCompilerFlavor v) Source # | |||||
Defined in Distribution.Compiler gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PerCompilerFlavor v -> c (PerCompilerFlavor v) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (PerCompilerFlavor v) Source # toConstr :: PerCompilerFlavor v -> Constr Source # dataTypeOf :: PerCompilerFlavor v -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (PerCompilerFlavor v)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (PerCompilerFlavor v)) Source # gmapT :: (forall b. Data b => b -> b) -> PerCompilerFlavor v -> PerCompilerFlavor v Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PerCompilerFlavor v -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PerCompilerFlavor v -> r Source # gmapQ :: (forall d. Data d => d -> u) -> PerCompilerFlavor v -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> PerCompilerFlavor v -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PerCompilerFlavor v -> m (PerCompilerFlavor v) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PerCompilerFlavor v -> m (PerCompilerFlavor v) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PerCompilerFlavor v -> m (PerCompilerFlavor v) Source # | |||||
(Semigroup a, Monoid a) => Monoid (PerCompilerFlavor a) Source # | |||||
Defined in Distribution.Compiler mempty :: PerCompilerFlavor a Source # mappend :: PerCompilerFlavor a -> PerCompilerFlavor a -> PerCompilerFlavor a Source # mconcat :: [PerCompilerFlavor a] -> PerCompilerFlavor a Source # | |||||
Semigroup a => Semigroup (PerCompilerFlavor a) Source # | |||||
Defined in Distribution.Compiler (<>) :: PerCompilerFlavor a -> PerCompilerFlavor a -> PerCompilerFlavor a Source # sconcat :: NonEmpty (PerCompilerFlavor a) -> PerCompilerFlavor a Source # stimes :: Integral b => b -> PerCompilerFlavor a -> PerCompilerFlavor a Source # | |||||
Generic (PerCompilerFlavor v) Source # | |||||
Defined in Distribution.Compiler
from :: PerCompilerFlavor v -> Rep (PerCompilerFlavor v) x Source # to :: Rep (PerCompilerFlavor v) x -> PerCompilerFlavor v Source # | |||||
Read v => Read (PerCompilerFlavor v) Source # | |||||
Defined in Distribution.Compiler readsPrec :: Int -> ReadS (PerCompilerFlavor v) Source # readList :: ReadS [PerCompilerFlavor v] Source # readPrec :: ReadPrec (PerCompilerFlavor v) Source # readListPrec :: ReadPrec [PerCompilerFlavor v] Source # | |||||
Show v => Show (PerCompilerFlavor v) Source # | |||||
Defined in Distribution.Compiler | |||||
Binary a => Binary (PerCompilerFlavor a) Source # | |||||
Defined in Distribution.Compiler put :: PerCompilerFlavor a -> Put Source # get :: Get (PerCompilerFlavor a) Source # putList :: [PerCompilerFlavor a] -> Put Source # | |||||
NFData a => NFData (PerCompilerFlavor a) Source # | |||||
Defined in Distribution.Compiler rnf :: PerCompilerFlavor a -> () Source # | |||||
Eq v => Eq (PerCompilerFlavor v) Source # | |||||
Defined in Distribution.Compiler (==) :: PerCompilerFlavor v -> PerCompilerFlavor v -> Bool # (/=) :: PerCompilerFlavor v -> PerCompilerFlavor v -> Bool # | |||||
Ord v => Ord (PerCompilerFlavor v) Source # | |||||
Defined in Distribution.Compiler compare :: PerCompilerFlavor v -> PerCompilerFlavor v -> Ordering # (<) :: PerCompilerFlavor v -> PerCompilerFlavor v -> Bool # (<=) :: PerCompilerFlavor v -> PerCompilerFlavor v -> Bool # (>) :: PerCompilerFlavor v -> PerCompilerFlavor v -> Bool # (>=) :: PerCompilerFlavor v -> PerCompilerFlavor v -> Bool # max :: PerCompilerFlavor v -> PerCompilerFlavor v -> PerCompilerFlavor v # min :: PerCompilerFlavor v -> PerCompilerFlavor v -> PerCompilerFlavor v # | |||||
type Rep (PerCompilerFlavor v) Source # | |||||
Defined in Distribution.Compiler type Rep (PerCompilerFlavor v) = D1 ('MetaData "PerCompilerFlavor" "Distribution.Compiler" "Cabal-syntax-3.10.2.0-2e8e" '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))) |
perCompilerFlavorToList :: PerCompilerFlavor v -> [(CompilerFlavor, v)] Source #
Compiler id
data CompilerId Source #
Instances
Parsec CompilerId Source # | |||||
Defined in Distribution.Compiler parsec :: CabalParsing m => m CompilerId Source # | |||||
Pretty CompilerId Source # | |||||
Defined in Distribution.Compiler pretty :: CompilerId -> Doc Source # prettyVersioned :: CabalSpecVersion -> CompilerId -> Doc Source # | |||||
Structured CompilerId Source # | |||||
Defined in Distribution.Compiler structure :: Proxy CompilerId -> Structure Source # structureHash' :: Tagged CompilerId MD5 | |||||
Generic CompilerId Source # | |||||
Defined in Distribution.Compiler
from :: CompilerId -> Rep CompilerId x Source # to :: Rep CompilerId x -> CompilerId Source # | |||||
Read CompilerId Source # | |||||
Defined in Distribution.Compiler | |||||
Show CompilerId Source # | |||||
Defined in Distribution.Compiler | |||||
Binary CompilerId Source # | |||||
Defined in Distribution.Compiler put :: CompilerId -> Put Source # get :: Get CompilerId Source # putList :: [CompilerId] -> Put Source # | |||||
NFData CompilerId Source # | |||||
Defined in Distribution.Compiler rnf :: CompilerId -> () Source # | |||||
Eq CompilerId Source # | |||||
Defined in Distribution.Compiler (==) :: CompilerId -> CompilerId -> Bool # (/=) :: CompilerId -> CompilerId -> Bool # | |||||
Ord CompilerId Source # | |||||
Defined in Distribution.Compiler compare :: CompilerId -> CompilerId -> Ordering # (<) :: CompilerId -> CompilerId -> Bool # (<=) :: CompilerId -> CompilerId -> Bool # (>) :: CompilerId -> CompilerId -> Bool # (>=) :: CompilerId -> CompilerId -> Bool # max :: CompilerId -> CompilerId -> CompilerId # min :: CompilerId -> CompilerId -> CompilerId # | |||||
type Rep CompilerId Source # | |||||
Defined in Distribution.Compiler type Rep CompilerId = D1 ('MetaData "CompilerId" "Distribution.Compiler" "Cabal-syntax-3.10.2.0-2e8e" '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.
CompilerInfo | |
|
Instances
Generic CompilerInfo Source # | |||||
Defined in Distribution.Compiler
from :: CompilerInfo -> Rep CompilerInfo x Source # to :: Rep CompilerInfo x -> CompilerInfo Source # | |||||
Read CompilerInfo Source # | |||||
Defined in Distribution.Compiler | |||||
Show CompilerInfo Source # | |||||
Defined in Distribution.Compiler | |||||
Binary CompilerInfo Source # | |||||
Defined in Distribution.Compiler put :: CompilerInfo -> Put Source # get :: Get CompilerInfo Source # putList :: [CompilerInfo] -> Put Source # | |||||
type Rep CompilerInfo Source # | |||||
Defined in Distribution.Compiler type Rep CompilerInfo = D1 ('MetaData "CompilerInfo" "Distribution.Compiler" "Cabal-syntax-3.10.2.0-2e8e" '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 parsec :: CabalParsing m => m AbiTag Source # | |||||
Pretty AbiTag Source # | |||||
Defined in Distribution.Compiler | |||||
Structured AbiTag Source # | |||||
Defined in Distribution.Compiler | |||||
Generic AbiTag Source # | |||||
Defined in Distribution.Compiler
| |||||
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.10.2.0-2e8e" '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 #