Cabal-syntax-3.12.1.0: A library for working with .cabal files

Safe Haskell | None
Language | Haskell2010

Distribution.Types.MungedPackageId

Synopsis

- data MungedPackageId = MungedPackageId {
  - mungedName :: MungedPackageName
  - mungedVersion :: Version
  }
- computeCompatPackageId :: PackageId -> LibraryName -> MungedPackageId

# Documentation

data MungedPackageId Source #

A simple pair of a `MungedPackageName` and `Version`. `MungedPackageName` is to `MungedPackageId` as `PackageName` is to `PackageId`. See `MungedPackageName` for more info.

Constructors

MungedPackageId |

Fields

- mungedName :: MungedPackageName

  The combined package and component name. see documentation for `MungedPackageName`.

- mungedVersion :: Version

  The version of this package / component, eg 1.2

#### Instances

Instances details

HasMungedPackageId MungedPackageId Source # |
Instance details Defined in Distribution.Package Methods mungedId :: MungedPackageId -> MungedPackageId Source #

Parsec MungedPackageId Source #

    >>> simpleParsec "foo-bar-0" :: Maybe MungedPackageId
    Just (MungedPackageId {mungedName = MungedPackageName (PackageName "foo-bar") LMainLibName, mungedVersion = mkVersion [0]})

    >>> simpleParsec "foo-bar" :: Maybe MungedPackageId
    Just (MungedPackageId {mungedName = MungedPackageName (PackageName "foo-bar") LMainLibName, mungedVersion = mkVersion []})

    >>> simpleParsec "z-foo-bar-z-baz-0" :: Maybe MungedPackageId
    Just (MungedPackageId {mungedName = MungedPackageName (PackageName "foo-bar") (LSubLibName (UnqualComponentName "baz")), mungedVersion = mkVersion [0]})

    >>> simpleParsec "foo-bar-0-0" :: Maybe MungedPackageId
    Nothing

    >>> simpleParsec "foo-bar.0" :: Maybe MungedPackageId
    Nothing

    >>> simpleParsec "foo-bar.4-2" :: Maybe MungedPackageId
    Nothing

Instance details Defined in Distribution.Types.MungedPackageId Methods parsec :: CabalParsing m => m MungedPackageId Source #

Pretty MungedPackageId Source #

    >>> prettyShow $ MungedPackageId (MungedPackageName "servant" LMainLibName) (mkVersion [1,2,3])
    "servant-1.2.3"

    >>> prettyShow $ MungedPackageId (MungedPackageName "servant" (LSubLibName "lackey")) (mkVersion [0,1,2])
    "z-servant-z-lackey-0.1.2"

Instance details Defined in Distribution.Types.MungedPackageId Methods pretty :: MungedPackageId -> Doc Source # prettyVersioned :: CabalSpecVersion -> MungedPackageId -> Doc Source #
Structured MungedPackageId Source # |
Instance details Defined in Distribution.Types.MungedPackageId Methods structure :: Proxy MungedPackageId -> Structure Source # structureHash' :: Tagged MungedPackageId MD5
Binary MungedPackageId Source # |
Instance details Defined in Distribution.Types.MungedPackageId Methods put :: MungedPackageId -> Put Source # get :: Get MungedPackageId Source # putList :: [MungedPackageId] -> Put Source #
NFData MungedPackageId Source # |
Instance details Defined in Distribution.Types.MungedPackageId Methods rnf :: MungedPackageId -> () Source #
Data MungedPackageId Source # |

Instance details

Defined in Distribution.Types.MungedPackageId

Methods

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

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

toConstr :: MungedPackageId -> Constr #

dataTypeOf :: MungedPackageId -> DataType #

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

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

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

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

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

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

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

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

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

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

Generic MungedPackageId Source # |

Instance details

Defined in Distribution.Types.MungedPackageId

Associated Types

type Rep MungedPackageId |

Instance details

Defined in Distribution.Types.MungedPackageId

type Rep MungedPackageId = D1 ('MetaData "MungedPackageId" "Distribution.Types.MungedPackageId" "Cabal-syntax-3.12.1.0-5c0e" 'False) (C1 ('MetaCons "MungedPackageId" 'PrefixI 'True) (S1 ('MetaSel ('Just "mungedName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MungedPackageName) :*: S1 ('MetaSel ('Just "mungedVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)))

Methods

from :: MungedPackageId -> Rep MungedPackageId x #

to :: Rep MungedPackageId x -> MungedPackageId #

Read MungedPackageId Source # |
Instance details Defined in Distribution.Types.MungedPackageId Methods readsPrec :: Int -> ReadS MungedPackageId # readList :: ReadS [MungedPackageId] # readPrec :: ReadPrec MungedPackageId # readListPrec :: ReadPrec [MungedPackageId] #
Show MungedPackageId Source # |
Instance details Defined in Distribution.Types.MungedPackageId Methods showsPrec :: Int -> MungedPackageId -> ShowS # show :: MungedPackageId -> String # showList :: [MungedPackageId] -> ShowS #
Eq MungedPackageId Source # |
Instance details Defined in Distribution.Types.MungedPackageId Methods (==) :: MungedPackageId -> MungedPackageId -> Bool # (/=) :: MungedPackageId -> MungedPackageId -> Bool #
Ord MungedPackageId Source # |

Instance details

Defined in Distribution.Types.MungedPackageId

Methods

compare :: MungedPackageId -> MungedPackageId -> Ordering #

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

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

(>) :: MungedPackageId -> MungedPackageId -> Bool #

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

max :: MungedPackageId -> MungedPackageId -> MungedPackageId #

min :: MungedPackageId -> MungedPackageId -> MungedPackageId #

type Rep MungedPackageId Source # |

Instance details

Defined in Distribution.Types.MungedPackageId

type Rep MungedPackageId = D1 ('MetaData "MungedPackageId" "Distribution.Types.MungedPackageId" "Cabal-syntax-3.12.1.0-5c0e" 'False) (C1 ('MetaCons "MungedPackageId" 'PrefixI 'True) (S1 ('MetaSel ('Just "mungedName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MungedPackageName) :*: S1 ('MetaSel ('Just "mungedVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)))

computeCompatPackageId :: PackageId -> LibraryName -> MungedPackageId Source #