Skip to content

Commit f5a1571

Browse files
committed
feat(cabal-install-solver): add Pretty instance for SolverId
1 parent 20aa401 commit f5a1571

File tree

1 file changed

+6
-0
lines changed
  • cabal-install-solver/src/Distribution/Solver/Types

1 file changed

+6
-0
lines changed

cabal-install-solver/src/Distribution/Solver/Types/SolverId.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import Distribution.Solver.Compat.Prelude
99
import Prelude ()
1010

1111
import Distribution.Package (PackageId, Package(..), UnitId)
12+
import Distribution.Pretty (Pretty (..))
13+
import Text.PrettyPrint (parens)
1214

1315
-- | The solver can produce references to existing packages or
1416
-- packages we plan to install. Unlike 'ConfiguredId' we don't
@@ -27,3 +29,7 @@ instance Show SolverId where
2729

2830
instance Package SolverId where
2931
packageId = solverSrcId
32+
33+
instance Pretty SolverId where
34+
pretty (PreExistingId pkg unitId) = pretty pkg <+> parens (pretty unitId)
35+
pretty (PlannedId pkg) = pretty pkg

0 commit comments

Comments
 (0)