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

Safe Haskell | None
Language | Haskell2010

Distribution.Client.Types.SourcePackageDb

Synopsis

- data SourcePackageDb = SourcePackageDb {
  - packageIndex :: PackageIndex UnresolvedSourcePackage
  - packagePreferences :: Map PackageName VersionRange
  }
- lookupDependency :: SourcePackageDb -> PackageName -> VersionRange -> [UnresolvedSourcePackage]
- lookupPackageName :: SourcePackageDb -> PackageName -> [UnresolvedSourcePackage]

# Documentation

data SourcePackageDb #

This is the information we get from a `00-index.tar.gz` hackage index.

Constructors

SourcePackageDb |
Fields packageIndex :: PackageIndex UnresolvedSourcePackage packagePreferences :: Map PackageName VersionRange

#### Instances

Instances details

Binary SourcePackageDb # |
Instance details Defined in Distribution.Client.Types.SourcePackageDb Methods put :: SourcePackageDb -> Put # get :: Get SourcePackageDb # putList :: [SourcePackageDb] -> Put #
Generic SourcePackageDb # |
Instance details Defined in Distribution.Client.Types.SourcePackageDb Associated Types
type Rep SourcePackageDb |
Instance details Defined in Distribution.Client.Types.SourcePackageDb type Rep SourcePackageDb = D1 ('MetaData "SourcePackageDb" "Distribution.Client.Types.SourcePackageDb" "cabal-install-3.12.1.0-G554PkJj2SpDqyarXp9tbt" 'False) (C1 ('MetaCons "SourcePackageDb" 'PrefixI 'True) (S1 ('MetaSel ('Just "packageIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PackageIndex UnresolvedSourcePackage)) :*: S1 ('MetaSel ('Just "packagePreferences") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map PackageName VersionRange))))
Methods from :: SourcePackageDb -> Rep SourcePackageDb x # to :: Rep SourcePackageDb x -> SourcePackageDb #
Eq SourcePackageDb # |
Instance details Defined in Distribution.Client.Types.SourcePackageDb Methods (==) :: SourcePackageDb -> SourcePackageDb -> Bool # (/=) :: SourcePackageDb -> SourcePackageDb -> Bool #
type Rep SourcePackageDb # |
Instance details Defined in Distribution.Client.Types.SourcePackageDb type Rep SourcePackageDb = D1 ('MetaData "SourcePackageDb" "Distribution.Client.Types.SourcePackageDb" "cabal-install-3.12.1.0-G554PkJj2SpDqyarXp9tbt" 'False) (C1 ('MetaCons "SourcePackageDb" 'PrefixI 'True) (S1 ('MetaSel ('Just "packageIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PackageIndex UnresolvedSourcePackage)) :*: S1 ('MetaSel ('Just "packagePreferences") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map PackageName VersionRange))))

lookupDependency :: SourcePackageDb -> PackageName -> VersionRange -> [UnresolvedSourcePackage] #

Does a case-sensitive search by package name and a range of versions.

We get back any number of versions of the specified package name, all satisfying the version range constraint.

Additionally, `preferred-versions` (such as version deprecation) are honoured in this lookup, which is the only difference to `lookupDependency`

lookupPackageName :: SourcePackageDb -> PackageName -> [UnresolvedSourcePackage] #

Does a case-sensitive search by package name.

Additionally, `preferred-versions` (such as version deprecation) are honoured in this lookup, which is the only difference to `lookupPackageName`