Skip to content
  • Edsko de Vries's avatar
    Split the PackageInstalled class · 2ea3dde1
    Edsko de Vries authored
    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.
    2ea3dde1