Cabal-syntax-3.10.3.0: A library for working with .cabal files
Safe HaskellNone
LanguageHaskell2010

Distribution.Types.Mixin

Synopsis

Documentation

data Mixin Source #

Invariant: if mixinLibraryName is LSubLibName, it's not the same as mixinPackageName. In other words, the same invariant as Dependency has.

Instances

Instances details
Parsec Mixin Source #
>>> simpleParsec "mylib" :: Maybe Mixin
Just (Mixin {mixinPackageName = PackageName "mylib", mixinLibraryName = LMainLibName, mixinIncludeRenaming = IncludeRenaming {includeProvidesRn = DefaultRenaming, includeRequiresRn = DefaultRenaming}})
>>> simpleParsec "thatlib:sublib" :: Maybe Mixin
Just (Mixin {mixinPackageName = PackageName "thatlib", mixinLibraryName = LSubLibName (UnqualComponentName "sublib"), mixinIncludeRenaming = IncludeRenaming {includeProvidesRn = DefaultRenaming, includeRequiresRn = DefaultRenaming}})
>>> simpleParsec "thatlib:thatlib" :: Maybe Mixin
Just (Mixin {mixinPackageName = PackageName "thatlib", mixinLibraryName = LMainLibName, mixinIncludeRenaming = IncludeRenaming {includeProvidesRn = DefaultRenaming, includeRequiresRn = DefaultRenaming}})

Sublibrary syntax is accepted since cabal-version: 3.4.

>>> map (`simpleParsec'` "mylib:sub") [CabalSpecV3_0, CabalSpecV3_4] :: [Maybe Mixin]
[Nothing,Just (Mixin {mixinPackageName = PackageName "mylib", mixinLibraryName = LSubLibName (UnqualComponentName "sub"), mixinIncludeRenaming = IncludeRenaming {includeProvidesRn = DefaultRenaming, includeRequiresRn = DefaultRenaming}})]
Instance details

Defined in Distribution.Types.Mixin

Methods

parsec :: CabalParsing m => m Mixin Source #

Pretty Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

Structured Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

Data Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

Methods

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

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

toConstr :: Mixin -> Constr Source #

dataTypeOf :: Mixin -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Generic Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

Associated Types

type Rep Mixin 
Instance details

Defined in Distribution.Types.Mixin

type Rep Mixin = D1 ('MetaData "Mixin" "Distribution.Types.Mixin" "Cabal-syntax-3.10.3.0-9bb5" 'False) (C1 ('MetaCons "Mixin" 'PrefixI 'True) (S1 ('MetaSel ('Just "mixinPackageName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: (S1 ('MetaSel ('Just "mixinLibraryName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibraryName) :*: S1 ('MetaSel ('Just "mixinIncludeRenaming") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IncludeRenaming))))

Methods

from :: Mixin -> Rep Mixin x Source #

to :: Rep Mixin x -> Mixin Source #

Read Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

Show Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

Binary Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

NFData Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

Methods

rnf :: Mixin -> () Source #

Eq Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

Methods

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

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

Ord Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

Methods

compare :: Mixin -> Mixin -> Ordering #

(<) :: Mixin -> Mixin -> Bool #

(<=) :: Mixin -> Mixin -> Bool #

(>) :: Mixin -> Mixin -> Bool #

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

max :: Mixin -> Mixin -> Mixin #

min :: Mixin -> Mixin -> Mixin #

type Rep Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

type Rep Mixin = D1 ('MetaData "Mixin" "Distribution.Types.Mixin" "Cabal-syntax-3.10.3.0-9bb5" 'False) (C1 ('MetaCons "Mixin" 'PrefixI 'True) (S1 ('MetaSel ('Just "mixinPackageName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: (S1 ('MetaSel ('Just "mixinLibraryName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibraryName) :*: S1 ('MetaSel ('Just "mixinIncludeRenaming") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IncludeRenaming))))

mkMixin :: PackageName -> LibraryName -> IncludeRenaming -> Mixin Source #

Smart constructor of Mixin, enforces invariant.

Since: Cabal-syntax-3.4.0.0

normaliseMixin :: Mixin -> Mixin Source #

Restore invariant