Split the PackageInstalled class
Introduce a new superclass HasInstalledPackageId: class Package pkg => HasInstalledPackageId pkg where installedPackageId :: pkg -> InstalledPackageId class HasInstalledPackageId pkg => PackageInstalled pkg where installedDepends :: pkg -> [InstalledPackageId] Most functions that deal with the package index now just require HasInstalledPackageId; only the functions that actually require the dependencies still rely on PackageInstalled. The point is that a ConfiguredPackage/ReadyPackage/PlanPackage can reasonably be made an instance of HasInstalledPackageId, but not of PackageInstalled; that will be the topic of the next, much larger, pull request.
Showing
- Cabal/Distribution/InstalledPackageInfo.hs 4 additions, 2 deletionsCabal/Distribution/InstalledPackageInfo.hs
- Cabal/Distribution/Package.hs 6 additions, 2 deletionsCabal/Distribution/Package.hs
- Cabal/Distribution/Simple/PackageIndex.hs 20 additions, 19 deletionsCabal/Distribution/Simple/PackageIndex.hs
- cabal-install/Distribution/Client/InstallPlan.hs 3 additions, 2 deletionscabal-install/Distribution/Client/InstallPlan.hs
- cabal-install/Distribution/Client/Types.hs 7 additions, 4 deletionscabal-install/Distribution/Client/Types.hs
Loading
Please register or sign in to comment