From 911b32b10c3c146902534c2912c7e0bd984205d0 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Wed, 20 Mar 2024 14:14:57 -0400 Subject: [PATCH] Still use showOption when linked --- .../src/Distribution/Solver/Modular/Message.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cabal-install-solver/src/Distribution/Solver/Modular/Message.hs b/cabal-install-solver/src/Distribution/Solver/Modular/Message.hs index 54bc26e99e3..35d24ca6d30 100644 --- a/cabal-install-solver/src/Distribution/Solver/Modular/Message.hs +++ b/cabal-install-solver/src/Distribution/Solver/Modular/Message.hs @@ -12,7 +12,7 @@ import Data.Map (Map) import qualified Data.Map as M import Data.Set (Set) import qualified Data.Set as S -import Data.Maybe (catMaybes, mapMaybe) +import Data.Maybe (catMaybes, mapMaybe, isJust) import Prelude hiding (pi) import Distribution.Pretty (prettyShow) -- from Cabal @@ -259,8 +259,13 @@ showOption qpn@(Q _pp pn) (POption i linkedTo) = -- "unexpected empty list of versions" showIsOrVs :: QPN -> [POption] -> String showIsOrVs _ [] = "unexpected empty list of versions" -showIsOrVs q [x] = let POption i _ = x in showPI (PI q i) -showIsOrVs q xs = showQPN q ++ "; " ++ (L.intercalate ", " [showI i | POption i _ <- xs]) +showIsOrVs q [x] = showOption q x +showIsOrVs q xs = showQPN q ++ "; " ++ (L.intercalate ", " + [if isJust linkedTo + then showOption q x + else showI i -- Don't show the package, just the version + | x@(POption i linkedTo) <- xs + ]) showGR :: QGoalReason -> String showGR UserGoal = " (user goal)"