@@ -204,15 +204,8 @@ import qualified Data.Set as Set
204
204
import Network.URI (URI (.. ), nullURIAuth , parseURI )
205
205
import System.Directory (createDirectoryIfMissing , makeAbsolute )
206
206
import System.FilePath (isAbsolute , isPathSeparator , makeValid , splitFileName , (</>) )
207
- import Text.PrettyPrint
208
- ( Doc
209
- , render
210
- , semi
211
- , text
212
- , vcat
213
- , ($+$)
214
- )
215
- import qualified Text.PrettyPrint as Disp (empty , int , render , text )
207
+ import Text.PrettyPrint (Doc , int , render , semi , text , vcat , ($+$) )
208
+ import qualified Text.PrettyPrint as Disp (empty )
216
209
217
210
------------------------------------------------------------------
218
211
-- Handle extended project config files with conditionals and imports.
@@ -289,7 +282,7 @@ type DupesMap = Map FilePath [Dupes]
289
282
dupesMsg :: (FilePath , [Dupes ]) -> Doc
290
283
dupesMsg (duplicate, ds@ (take 1 . sortOn dupesNormLocPath -> dupes)) =
291
284
vcat $
292
- ((text " Warning:" <+> Disp. int (length ds) <+> text " imports of" <+> text duplicate) <> semi)
285
+ ((text " Warning:" <+> int (length ds) <+> text " imports of" <+> text duplicate) <> semi)
293
286
: ((\ Dupes {.. } -> duplicateImportMsg Disp. empty dupesUniqueImport dupesNormLocPath dupesSeenImportsBy) <$> dupes)
294
287
295
288
parseProjectSkeleton
@@ -329,7 +322,7 @@ parseProjectSkeleton cacheDir httpTransport verbosity importsBy dupesMap project
329
322
else do
330
323
when
331
324
(isUntrimmedUriConfigPath importLocPath)
332
- (noticeDoc verbosity $ untrimmedUriImportMsg (Disp. text " Warning:" ) importLocPath)
325
+ (noticeDoc verbosity $ untrimmedUriImportMsg (text " Warning:" ) importLocPath)
333
326
let fs = (\ z -> CondNode z [normLocPath] mempty ) <$> fieldsToConfig normSource (reverse acc)
334
327
let uniqueFields = if uniqueImport `elem` seenImports then [] else xs
335
328
atomicModifyIORef' dupesMap $ \ dm -> (Map. insertWith (++) uniqueImport [Dupes uniqueImport normLocPath seenImportsBy] dm, () )
@@ -1327,13 +1320,13 @@ parseLegacyProjectConfig rootConfig bs =
1327
1320
1328
1321
showLegacyProjectConfig :: LegacyProjectConfig -> String
1329
1322
showLegacyProjectConfig config =
1330
- Disp. render $
1323
+ render $
1331
1324
showConfig
1332
1325
(legacyProjectConfigFieldDescrs constraintSrc)
1333
1326
legacyPackageConfigSectionDescrs
1334
1327
legacyPackageConfigFGSectionDescrs
1335
1328
config
1336
- $+$ Disp. text " "
1329
+ $+$ text " "
1337
1330
where
1338
1331
-- Note: ConstraintSource is unused when pretty-printing. We fake
1339
1332
-- it here to avoid having to pass it on call-sites. It's not great
@@ -1344,13 +1337,13 @@ legacyProjectConfigFieldDescrs :: ConstraintSource -> [FieldDescr LegacyProjectC
1344
1337
legacyProjectConfigFieldDescrs constraintSrc =
1345
1338
[ newLineListField
1346
1339
" packages"
1347
- (Disp. text . renderPackageLocationToken)
1340
+ (text . renderPackageLocationToken)
1348
1341
parsePackageLocationTokenQ
1349
1342
legacyPackages
1350
1343
(\ v flags -> flags{legacyPackages = v})
1351
1344
, newLineListField
1352
1345
" optional-packages"
1353
- (Disp. text . renderPackageLocationToken)
1346
+ (text . renderPackageLocationToken)
1354
1347
parsePackageLocationTokenQ
1355
1348
legacyPackagesOptional
1356
1349
(\ v flags -> flags{legacyPackagesOptional = v})
@@ -1461,7 +1454,7 @@ legacySharedConfigFieldDescrs constraintSrc =
1461
1454
. addFields
1462
1455
[ commaNewLineListFieldParsec
1463
1456
" package-dbs"
1464
- (Disp. text . showPackageDb)
1457
+ (text . showPackageDb)
1465
1458
(fmap readPackageDb parsecToken)
1466
1459
configPackageDBs
1467
1460
(\ v conf -> conf{configPackageDBs = v})
@@ -1754,8 +1747,8 @@ legacyPackageConfigFieldDescrs =
1754
1747
in FieldDescr
1755
1748
name
1756
1749
( \ f -> case f of
1757
- Flag NoDumpBuildInfo -> Disp. text " False"
1758
- Flag DumpBuildInfo -> Disp. text " True"
1750
+ Flag NoDumpBuildInfo -> text " False"
1751
+ Flag DumpBuildInfo -> text " True"
1759
1752
_ -> Disp. empty
1760
1753
)
1761
1754
( \ line str _ -> case () of
@@ -1782,9 +1775,9 @@ legacyPackageConfigFieldDescrs =
1782
1775
in FieldDescr
1783
1776
name
1784
1777
( \ f -> case f of
1785
- Flag NoOptimisation -> Disp. text " False"
1786
- Flag NormalOptimisation -> Disp. text " True"
1787
- Flag MaximumOptimisation -> Disp. text " 2"
1778
+ Flag NoOptimisation -> text " False"
1779
+ Flag NormalOptimisation -> text " True"
1780
+ Flag MaximumOptimisation -> text " 2"
1788
1781
_ -> Disp. empty
1789
1782
)
1790
1783
( \ line str _ -> case () of
@@ -1807,10 +1800,10 @@ legacyPackageConfigFieldDescrs =
1807
1800
in FieldDescr
1808
1801
name
1809
1802
( \ f -> case f of
1810
- Flag NoDebugInfo -> Disp. text " False"
1811
- Flag MinimalDebugInfo -> Disp. text " 1"
1812
- Flag NormalDebugInfo -> Disp. text " True"
1813
- Flag MaximalDebugInfo -> Disp. text " 3"
1803
+ Flag NoDebugInfo -> text " False"
1804
+ Flag MinimalDebugInfo -> text " 1"
1805
+ Flag NormalDebugInfo -> text " True"
1806
+ Flag MaximalDebugInfo -> text " 3"
1814
1807
_ -> Disp. empty
1815
1808
)
1816
1809
( \ line str _ -> case () of
@@ -2135,6 +2128,6 @@ monoidFieldParsec name showF readF get' set =
2135
2128
-- otherwise are special syntax.
2136
2129
showTokenQ :: String -> Doc
2137
2130
showTokenQ " " = Disp. empty
2138
- showTokenQ x@ (' -' : ' -' : _) = Disp. text (show x)
2139
- showTokenQ x@ (' .' : [] ) = Disp. text (show x)
2131
+ showTokenQ x@ (' -' : ' -' : _) = text (show x)
2132
+ showTokenQ x@ (' .' : [] ) = text (show x)
2140
2133
showTokenQ x = showToken x
0 commit comments