Skip to content

Commit 301827e

Browse files
committed
Use Pretty in D.S.T.PackagePath
1 parent f1a4a69 commit 301827e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cabal-install/Distribution/Solver/Types/PackagePath.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module Distribution.Solver.Types.PackagePath
1010
) where
1111

1212
import Distribution.Package
13-
import Distribution.Deprecated.Text
13+
import Distribution.Pretty (pretty, flatStyle)
1414
import qualified Text.PrettyPrint as Disp
1515
import Distribution.Solver.Compat.Prelude ((<<>>))
1616

@@ -35,7 +35,7 @@ data Namespace =
3535
-- ends in a period, so it can be prepended onto a qualifier.
3636
dispNamespace :: Namespace -> Disp.Doc
3737
dispNamespace DefaultNamespace = Disp.empty
38-
dispNamespace (Independent i) = disp i <<>> Disp.text "."
38+
dispNamespace (Independent i) = pretty i <<>> Disp.text "."
3939

4040
-- | Qualifier of a package within a namespace (see 'PackagePath')
4141
data Qualifier =
@@ -79,10 +79,10 @@ data Qualifier =
7979
-- 'Base' qualifier, will always be @base@).
8080
dispQualifier :: Qualifier -> Disp.Doc
8181
dispQualifier QualToplevel = Disp.empty
82-
dispQualifier (QualSetup pn) = disp pn <<>> Disp.text ":setup."
83-
dispQualifier (QualExe pn pn2) = disp pn <<>> Disp.text ":" <<>>
84-
disp pn2 <<>> Disp.text ":exe."
85-
dispQualifier (QualBase pn) = disp pn <<>> Disp.text "."
82+
dispQualifier (QualSetup pn) = pretty pn <<>> Disp.text ":setup."
83+
dispQualifier (QualExe pn pn2) = pretty pn <<>> Disp.text ":" <<>>
84+
pretty pn2 <<>> Disp.text ":exe."
85+
dispQualifier (QualBase pn) = pretty pn <<>> Disp.text "."
8686

8787
-- | A qualified entity. Pairs a package path with the entity.
8888
data Qualified a = Q PackagePath a
@@ -94,7 +94,7 @@ type QPN = Qualified PackageName
9494
-- | Pretty-prints a qualified package name.
9595
dispQPN :: QPN -> Disp.Doc
9696
dispQPN (Q (PackagePath ns qual) pn) =
97-
dispNamespace ns <<>> dispQualifier qual <<>> disp pn
97+
dispNamespace ns <<>> dispQualifier qual <<>> pretty pn
9898

9999
-- | String representation of a qualified package name.
100100
showQPN :: QPN -> String

0 commit comments

Comments
 (0)