-- | Much like 'planPkgIdOf', but mapping back to full packages.
planPkgOf :: GenericInstallPlan ipkg srcpkg iresult ifailure
          -> Graph.Vertex
          -> GenericPlanPackage ipkg srcpkg iresult ifailure
planPkgOf plan v =
    case PackageIndex.lookupUnitId (planIndex plan)
                                   (planPkgIdOf plan v) of
      Just pkg -> pkg
      Nothing  -> error "InstallPlan: internal error: planPkgOf lookup failed"

-- | 'GenericInstallPlan' that the solver produces.  We'll "run this" in
-- order to compute the 'UnitId's for everything we want to build.
planPkgOf :: GenericInstallPlan ipkg srcpkg iresult ifailure
          -> Graph.Vertex
          -> GenericPlanPackage ipkg srcpkg iresult ifailure
planPkgOf plan v =
    case PackageIndex.lookupUnitId (planIndex plan)
                                   (planPkgIdOf plan v) of
      Just pkg -> pkg
      Nothing  -> error "InstallPlan: internal error: planPkgOf lookup failed"

-- | 'GenericInstallPlan' that the solver produces.  We'll "run this" in
-- order to compute the 'UnitId's for everything we want to build.
planPkgOf plan v =
    case PackageIndex.lookupUnitId (planIndex plan)
                                   (planPkgIdOf plan v) of
      Just pkg -> pkg
      Nothing  -> error "InstallPlan: internal error: planPkgOf lookup failed"

-- | 'GenericInstallPlan' that the solver produces.  We'll "run this" in
-- order to compute the 'UnitId's for everything we want to build.