Cabal-syntax-3.12.0.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

Binary Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

NFData Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

Methods

rnf :: Mixin -> () Source #

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 #

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

toConstr :: Mixin -> Constr #

dataTypeOf :: Mixin -> DataType #

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

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

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

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

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

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

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

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

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

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

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.12.0.0-d5d4" '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 #

to :: Rep Mixin x -> Mixin #

Read Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

Show Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

Methods

showsPrec :: Int -> Mixin -> ShowS #

show :: Mixin -> String #

showList :: [Mixin] -> ShowS #

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.12.0.0-d5d4" '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