Skip to content

Commit fee1664

Browse files
committed
makeForest'
1 parent 7d89a66 commit fee1664

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cabal-install/src/Distribution/Client/Dependency.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ import qualified Data.Map as Map
169169
import qualified Data.Set as Set
170170
import Text.PrettyPrint hiding ((<>))
171171
import GHC.Stack (HasCallStack)
172-
import Distribution.Client.InstallPlan (toForest, renderForest)
172+
import Distribution.Client.InstallPlan (renderForest')
173173

174174
-- ------------------------------------------------------------
175175

@@ -823,7 +823,7 @@ resolveDependencies toolchains pkgConfigDB installedPkgIndex params = do
823823
[ text "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
824824
, text "Dependency tree"
825825
, text "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
826-
, text (renderForest $ Graph.fromDistinctList pkgs')
826+
, text (renderForest' (\p -> show (pretty (solverQPN p) <+> text "->" <+> pretty (Graph.nodeKey p))) $ Graph.fromDistinctList pkgs')
827827
]
828828

829829
validateSolverResult toolchains pkgs'

cabal-install/src/Distribution/Client/InstallPlan.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ module Distribution.Client.InstallPlan
7474
, project
7575
, toForest
7676
, renderForest
77+
, renderForest'
7778
, renderPlanForest
7879
) where
7980

@@ -553,6 +554,9 @@ toForest g = fmap (fmap graphVertexToNode) $ dfs graphForward (topSort graphForw
553554
renderForest :: (IsNode a, Pretty (Key a)) => Graph a -> String
554555
renderForest = drawForest . fmap (fmap (prettyShow . Graph.nodeKey)) . toForest
555556

557+
renderForest' :: (a -> String) -> Graph a -> String
558+
renderForest' f = drawForest . fmap (fmap f) . toForest
559+
556560
renderPlanForest :: (IsNode ipkg, IsNode srcpkg, Key ipkg ~ Key srcpkg, Pretty (Key srcpkg)) => GenericInstallPlan' key ipkg srcpkg -> String
557561
renderPlanForest = renderForest . planGraph
558562

0 commit comments

Comments
 (0)