never executed always true always false
1 {-# LANGUAGE DeriveGeneric #-}
2 {-# LANGUAGE TypeFamilies #-}
3 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
4 module Distribution.Client.Types.ReadyPackage (
5 GenericReadyPackage (..),
6 ReadyPackage,
7 ) where
8
9 import Distribution.Client.Compat.Prelude
10 import Prelude ()
11
12 import Distribution.Compat.Graph (IsNode (..))
13 import Distribution.Package (HasMungedPackageId, HasUnitId, Package, PackageInstalled)
14
15 import Distribution.Client.Types.ConfiguredPackage (ConfiguredPackage)
16 import Distribution.Client.Types.PackageLocation (UnresolvedPkgLoc)
17 import Distribution.Solver.Types.PackageFixedDeps
18
19 -- | Like 'ConfiguredPackage', but with all dependencies guaranteed to be
20 -- installed already, hence itself ready to be installed.
21 newtype GenericReadyPackage srcpkg = ReadyPackage srcpkg -- see 'ConfiguredPackage'.
22 deriving (Eq, Show, Generic, Package, PackageFixedDeps,
23 HasMungedPackageId, HasUnitId, PackageInstalled, Binary)
24
25 -- Can't newtype derive this
26 instance IsNode srcpkg => IsNode (GenericReadyPackage srcpkg) where
27 type Key (GenericReadyPackage srcpkg) = Key srcpkg
28 nodeKey (ReadyPackage spkg) = nodeKey spkg
29 nodeNeighbors (ReadyPackage spkg) = nodeNeighbors spkg
30
31 type ReadyPackage = GenericReadyPackage (ConfiguredPackage UnresolvedPkgLoc)