cabal-install-solver-3.12.1.0: The command-line interface for Cabal and Hackage.

Safe Haskell | None
Language | Haskell2010

Distribution.Solver.Modular.Package

Synopsis

- data I = I Ver Loc
- data Loc
  - = Inst PId
  - | InRepo
- type PackageId = PackageIdentifier
- data PackageIdentifier = PackageIdentifier {
  - pkgName :: PackageName
  - pkgVersion :: Version
  }
- data PackageName
- mkPackageName :: String -> PackageName
- unPackageName :: PackageName -> String
- data PkgconfigName
- mkPkgconfigName :: String -> PkgconfigName
- unPkgconfigName :: PkgconfigName -> String
- data PI qpn = PI qpn I
- type PN = PackageName
- type QPV = Qualified PV
- instI :: I -> Bool
- makeIndependent :: PN -> QPN
- primaryPP :: PackagePath -> Bool
- setupPP :: PackagePath -> Bool
- showI :: I -> String
- showPI :: PI QPN -> String
- unPN :: PN -> String

# Documentation

data I Source #

Instance. A version number and a location.

Constructors

I Ver Loc |

#### Instances

Instances details

Show I Source # |
Instance details Defined in Distribution.Solver.Modular.Package Methods showsPrec :: Int -> I -> ShowS Source # show :: I -> String Source # showList :: [I] -> ShowS Source #
Eq I Source # |
Instance details Defined in Distribution.Solver.Modular.Package Methods (==) :: I -> I -> Bool Source # (/=) :: I -> I -> Bool Source #
Ord I Source # |
Instance details Defined in Distribution.Solver.Modular.Package Methods compare :: I -> I -> Ordering Source # (<) :: I -> I -> Bool Source # (<=) :: I -> I -> Bool Source # (>) :: I -> I -> Bool Source # (>=) :: I -> I -> Bool Source # max :: I -> I -> I Source # min :: I -> I -> I Source #

data Loc Source #

Location. Info about whether a package is installed or not, and where exactly it is located. For installed packages, uniquely identifies the package instance via its `PId`.

TODO: More information is needed about the repo.

Constructors

Inst PId |
InRepo |

#### Instances

Instances details

Show Loc Source # |
Instance details Defined in Distribution.Solver.Modular.Package Methods showsPrec :: Int -> Loc -> ShowS Source # show :: Loc -> String Source # showList :: [Loc] -> ShowS Source #
Eq Loc Source # |
Instance details Defined in Distribution.Solver.Modular.Package Methods (==) :: Loc -> Loc -> Bool Source # (/=) :: Loc -> Loc -> Bool Source #
Ord Loc Source # |
Instance details Defined in Distribution.Solver.Modular.Package Methods compare :: Loc -> Loc -> Ordering Source # (<) :: Loc -> Loc -> Bool Source # (<=) :: Loc -> Loc -> Bool Source # (>) :: Loc -> Loc -> Bool Source # (>=) :: Loc -> Loc -> Bool Source # max :: Loc -> Loc -> Loc Source # min :: Loc -> Loc -> Loc Source #

type PackageId = PackageIdentifier Source #

Type alias so we can use the shorter name PackageId.

data PackageIdentifier Source #

The name and version of a package.

Constructors

PackageIdentifier |

Fields

- pkgName :: PackageName

  The name of this package, eg. foo

- pkgVersion :: Version

  the version of this package, eg 1.2

#### Instances

Instances details

Package PackageIdentifier |
Instance details Defined in Distribution.Package Methods packageId :: PackageIdentifier -> PackageIdentifier Source #

Parsec PackageIdentifier

    >>> simpleParsec "foo-bar-0" :: Maybe PackageIdentifier
    Just (PackageIdentifier {pkgName = PackageName "foo-bar", pkgVersion = mkVersion [0]})

    >>> simpleParsec "foo-bar" :: Maybe PackageIdentifier
    Just (PackageIdentifier {pkgName = PackageName "foo-bar", pkgVersion = mkVersion []})

Note: Stricter than `Text` instance

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

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

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

    >>> simpleParsec "1.2.3" :: Maybe PackageIdentifier
    Nothing

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

Instance details

Defined in Distribution.Types.PackageId

Methods

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

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

toConstr :: PackageIdentifier -> Constr Source #

dataTypeOf :: PackageIdentifier -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Generic PackageIdentifier |

Instance details

Defined in Distribution.Types.PackageId

Associated Types

type Rep PackageIdentifier |

Instance details

Defined in Distribution.Types.PackageId

type Rep PackageIdentifier = D1 ('MetaData "PackageIdentifier" "Distribution.Types.PackageId" "Cabal-syntax-3.12.1.0-inplace" 'False) (C1 ('MetaCons "PackageIdentifier" 'PrefixI 'True) (S1 ('MetaSel ('Just "pkgName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: S1 ('MetaSel ('Just "pkgVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)))

Methods

from :: PackageIdentifier -> Rep PackageIdentifier x Source #

to :: Rep PackageIdentifier x -> PackageIdentifier Source #

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

Instance details

Defined in Distribution.Types.PackageId

Methods

compare :: PackageIdentifier -> PackageIdentifier -> Ordering Source #

(<) :: PackageIdentifier -> PackageIdentifier -> Bool Source #

(<=) :: PackageIdentifier -> PackageIdentifier -> Bool Source #

(>) :: PackageIdentifier -> PackageIdentifier -> Bool Source #

(>=) :: PackageIdentifier -> PackageIdentifier -> Bool Source #

max :: PackageIdentifier -> PackageIdentifier -> PackageIdentifier Source #

min :: PackageIdentifier -> PackageIdentifier -> PackageIdentifier Source #

type Rep PackageIdentifier |

Instance details

Defined in Distribution.Types.PackageId

type Rep PackageIdentifier = D1 ('MetaData "PackageIdentifier" "Distribution.Types.PackageId" "Cabal-syntax-3.12.1.0-inplace" 'False) (C1 ('MetaCons "PackageIdentifier" 'PrefixI 'True) (S1 ('MetaSel ('Just "pkgName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: S1 ('MetaSel ('Just "pkgVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)))

data PackageName Source #

A package name.

Use `mkPackageName` and `unPackageName` to convert from/to a `String`.

This type is opaque since `Cabal-2.0`

Since: Cabal-syntax-2.0.0.2

#### Instances

Instances details

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

Instance details

Defined in Distribution.Types.PackageName

Methods

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

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

toConstr :: PackageName -> Constr Source #

dataTypeOf :: PackageName -> DataType Source #

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

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

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

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

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

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

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

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

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

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

IsString PackageName | `mkPackageName` Since: Cabal-syntax-2.0.0.2
Instance details Defined in Distribution.Types.PackageName Methods fromString :: String -> PackageName Source #
Generic PackageName |

Instance details

Defined in Distribution.Types.PackageName

Associated Types

type Rep PackageName |
Instance details Defined in Distribution.Types.PackageName type Rep PackageName = D1 ('MetaData "PackageName" "Distribution.Types.PackageName" "Cabal-syntax-3.12.1.0-inplace" 'True) (C1 ('MetaCons "PackageName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortText)))

Methods

from :: PackageName -> Rep PackageName x Source #

to :: Rep PackageName x -> PackageName Source #

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

Instance details

Defined in Distribution.Types.PackageName

Methods

compare :: PackageName -> PackageName -> Ordering Source #

(<) :: PackageName -> PackageName -> Bool Source #

(<=) :: PackageName -> PackageName -> Bool Source #

(>) :: PackageName -> PackageName -> Bool Source #

(>=) :: PackageName -> PackageName -> Bool Source #

max :: PackageName -> PackageName -> PackageName Source #

min :: PackageName -> PackageName -> PackageName Source #

type Rep PackageName |
Instance details Defined in Distribution.Types.PackageName type Rep PackageName = D1 ('MetaData "PackageName" "Distribution.Types.PackageName" "Cabal-syntax-3.12.1.0-inplace" 'True) (C1 ('MetaCons "PackageName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortText)))

mkPackageName :: String -> PackageName Source #

Construct a `PackageName` from a `String`

`mkPackageName` is the inverse to `unPackageName`

Note: No validations are performed to ensure that the resulting `PackageName` is valid

Since: Cabal-syntax-2.0.0.2

unPackageName :: PackageName -> String Source #

Convert `PackageName` to `String`

data PkgconfigName Source #

A pkg-config library name

This is parsed as any valid argument to the pkg-config utility.

Since: Cabal-syntax-2.0.0.2

#### Instances

Instances details

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

Instance details

Defined in Distribution.Types.PkgconfigName

Methods

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

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

toConstr :: PkgconfigName -> Constr Source #

dataTypeOf :: PkgconfigName -> DataType Source #

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

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

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

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

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

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

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

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

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

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

IsString PkgconfigName | `mkPkgconfigName` Since: Cabal-syntax-2.0.0.2
Instance details Defined in Distribution.Types.PkgconfigName Methods fromString :: String -> PkgconfigName Source #
Generic PkgconfigName |

Instance details

Defined in Distribution.Types.PkgconfigName

Associated Types

type Rep PkgconfigName |
Instance details Defined in Distribution.Types.PkgconfigName type Rep PkgconfigName = D1 ('MetaData "PkgconfigName" "Distribution.Types.PkgconfigName" "Cabal-syntax-3.12.1.0-inplace" 'True) (C1 ('MetaCons "PkgconfigName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortText)))

Methods

from :: PkgconfigName -> Rep PkgconfigName x Source #

to :: Rep PkgconfigName x -> PkgconfigName Source #

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

Instance details

Defined in Distribution.Types.PkgconfigName

Methods

compare :: PkgconfigName -> PkgconfigName -> Ordering Source #

(<) :: PkgconfigName -> PkgconfigName -> Bool Source #

(<=) :: PkgconfigName -> PkgconfigName -> Bool Source #

(>) :: PkgconfigName -> PkgconfigName -> Bool Source #

(>=) :: PkgconfigName -> PkgconfigName -> Bool Source #

max :: PkgconfigName -> PkgconfigName -> PkgconfigName Source #

min :: PkgconfigName -> PkgconfigName -> PkgconfigName Source #

type Rep PkgconfigName |
Instance details Defined in Distribution.Types.PkgconfigName type Rep PkgconfigName = D1 ('MetaData "PkgconfigName" "Distribution.Types.PkgconfigName" "Cabal-syntax-3.12.1.0-inplace" 'True) (C1 ('MetaCons "PkgconfigName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortText)))

mkPkgconfigName :: String -> PkgconfigName Source #

Construct a `PkgconfigName` from a `String`

`mkPkgconfigName` is the inverse to `unPkgconfigName`

Note: No validations are performed to ensure that the resulting `PkgconfigName` is valid

Since: Cabal-syntax-2.0.0.2

unPkgconfigName :: PkgconfigName -> String Source #

Convert `PkgconfigName` to `String`

Since: Cabal-syntax-2.0.0.2

data PI qpn Source #

Package instance. A package name and an instance.

Constructors

PI qpn I |

#### Instances

Instances details

Functor PI Source # |
Instance details Defined in Distribution.Solver.Modular.Package Methods fmap :: (a -> b) -> PI a -> PI b Source # (<$) :: a -> PI b -> PI a Source #
Show qpn => Show (PI qpn) Source # |
Instance details Defined in Distribution.Solver.Modular.Package Methods showsPrec :: Int -> PI qpn -> ShowS Source # show :: PI qpn -> String Source # showList :: [PI qpn] -> ShowS Source #
Eq qpn => Eq (PI qpn) Source # |
Instance details Defined in Distribution.Solver.Modular.Package Methods (==) :: PI qpn -> PI qpn -> Bool Source # (/=) :: PI qpn -> PI qpn -> Bool Source #
Ord qpn => Ord (PI qpn) Source # |
Instance details Defined in Distribution.Solver.Modular.Package Methods compare :: PI qpn -> PI qpn -> Ordering Source # (<) :: PI qpn -> PI qpn -> Bool Source # (<=) :: PI qpn -> PI qpn -> Bool Source # (>) :: PI qpn -> PI qpn -> Bool Source # (>=) :: PI qpn -> PI qpn -> Bool Source # max :: PI qpn -> PI qpn -> PI qpn Source # min :: PI qpn -> PI qpn -> PI qpn Source #

type PN = PackageName Source #

A package name.

type QPV = Qualified PV Source #

Qualified package version.

instI :: I -> Bool Source #

makeIndependent :: PN -> QPN Source #

Qualify a target package with its own name so that its dependencies are not required to be consistent with other targets.

primaryPP :: PackagePath -> Bool Source #

Is the package in the primary group of packages. This is used to determine (1) if we should try to establish stanza preferences for this goal, and (2) whether or not a user specified `--constraint` should apply to this dependency (grep `primaryPP` to see the use sites). In particular this does not include packages pulled in as setup deps.

setupPP :: PackagePath -> Bool Source #

Is the package a dependency of a setup script. This is used to establish whether or not certain constraints should apply to this dependency (grep `setupPP` to see the use sites).

showI :: I -> String Source #

String representation of an instance.

showPI :: PI QPN -> String Source #

String representation of a package instance.

unPN :: PN -> String Source #

Unpacking a package name.