Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
8a246551
Commit
8a246551
authored
Jan 06, 2017
by
Robert Henderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup: removed duplicated versions of 'showStanza'.
parent
3db6e93e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
16 deletions
+11
-16
cabal-install/Distribution/Client/Install.hs
cabal-install/Distribution/Client/Install.hs
+1
-3
cabal-install/Distribution/Client/Targets.hs
cabal-install/Distribution/Client/Targets.hs
+1
-3
cabal-install/Distribution/Solver/Modular/Flag.hs
cabal-install/Distribution/Solver/Modular/Flag.hs
+3
-7
cabal-install/Distribution/Solver/Types/OptionalStanza.hs
cabal-install/Distribution/Solver/Types/OptionalStanza.hs
+6
-0
cabal-install/Distribution/Solver/Types/PackageConstraint.hs
cabal-install/Distribution/Solver/Types/PackageConstraint.hs
+0
-3
No files found.
cabal-install/Distribution/Client/Install.hs
View file @
8a246551
...
...
@@ -695,9 +695,7 @@ printPlan dryRun verbosity plan sourcePkgDb = case plan of
in
confPkgFlags
cpkg
\\
defaultAssignment
showStanzas
::
[
OptionalStanza
]
->
String
showStanzas
=
concatMap
((
' '
:
)
.
showStanza
)
showStanza
TestStanzas
=
"*test"
showStanza
BenchStanzas
=
"*bench"
showStanzas
=
concatMap
((
" *"
++
)
.
showStanza
)
showFlagAssignment
::
FlagAssignment
->
String
showFlagAssignment
=
concatMap
((
' '
:
)
.
showFlagValue
)
...
...
cabal-install/Distribution/Client/Targets.hs
View file @
8a246551
...
...
@@ -755,9 +755,7 @@ instance Text UserConstraint where
disp
(
UserConstraintStanzas
pkgname
stanzas
)
=
disp
pkgname
<+>
dispStanzas
stanzas
where
dispStanzas
=
Disp
.
hsep
.
map
dispStanza
dispStanza
TestStanzas
=
Disp
.
text
"test"
dispStanza
BenchStanzas
=
Disp
.
text
"bench"
dispStanzas
=
Disp
.
hsep
.
map
(
Disp
.
text
.
showStanza
)
parse
=
parse
>>=
parseConstraint
where
...
...
cabal-install/Distribution/Solver/Modular/Flag.hs
View file @
8a246551
...
...
@@ -71,10 +71,6 @@ type QSN = SN QPN
newtype
WeakOrTrivial
=
WeakOrTrivial
{
unWeakOrTrivial
::
Bool
}
deriving
(
Eq
,
Ord
,
Show
)
unStanza
::
OptionalStanza
->
String
unStanza
TestStanzas
=
"test"
unStanza
BenchStanzas
=
"bench"
showQFNBool
::
QFN
->
Bool
->
String
showQFNBool
qfn
@
(
FN
pi
_f
)
b
=
showPI
pi
++
":"
++
showFBool
qfn
b
...
...
@@ -85,11 +81,11 @@ showFBool :: FN qpn -> Bool -> String
showFBool
(
FN
_
f
)
v
=
showFlagValue
(
f
,
v
)
showSBool
::
SN
qpn
->
Bool
->
String
showSBool
(
SN
_
s
)
True
=
"*"
++
un
Stanza
s
showSBool
(
SN
_
s
)
False
=
"!"
++
un
Stanza
s
showSBool
(
SN
_
s
)
True
=
"*"
++
show
Stanza
s
showSBool
(
SN
_
s
)
False
=
"!"
++
show
Stanza
s
showQFN
::
QFN
->
String
showQFN
(
FN
pi
f
)
=
showPI
pi
++
":"
++
unFlag
f
showQSN
::
QSN
->
String
showQSN
(
SN
pi
f
)
=
showPI
pi
++
":"
++
un
Stanza
f
showQSN
(
SN
pi
f
)
=
showPI
pi
++
":"
++
show
Stanza
f
cabal-install/Distribution/Solver/Types/OptionalStanza.hs
View file @
8a246551
...
...
@@ -2,6 +2,7 @@
{-# LANGUAGE DeriveDataTypeable #-}
module
Distribution.Solver.Types.OptionalStanza
(
OptionalStanza
(
..
)
,
showStanza
,
enableStanzas
)
where
...
...
@@ -17,6 +18,11 @@ data OptionalStanza
|
BenchStanzas
deriving
(
Eq
,
Ord
,
Enum
,
Bounded
,
Show
,
Generic
,
Typeable
)
-- | String representation of an OptionalStanza.
showStanza
::
OptionalStanza
->
String
showStanza
TestStanzas
=
"test"
showStanza
BenchStanzas
=
"bench"
-- | Convert a list of 'OptionalStanza' into the corresponding
-- 'ComponentRequestedSpec' which records what components are enabled.
enableStanzas
::
[
OptionalStanza
]
->
ComponentRequestedSpec
...
...
cabal-install/Distribution/Solver/Types/PackageConstraint.hs
View file @
8a246551
...
...
@@ -44,6 +44,3 @@ showPackageConstraint (PackageConstraintFlags pn fs) =
showFlag
f
False
=
"-"
++
unFlagName
f
showPackageConstraint
(
PackageConstraintStanzas
pn
ss
)
=
"stanzas "
++
display
pn
++
" "
++
unwords
(
map
showStanza
ss
)
where
showStanza
TestStanzas
=
"test"
showStanza
BenchStanzas
=
"bench"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment