Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
ab902857
Commit
ab902857
authored
Jun 26, 2016
by
kristenk
Browse files
Remove unnecessary references to QGoalReason
parent
8f6477d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Solver/Modular/Preference.hs
View file @
ab902857
...
...
@@ -191,8 +191,8 @@ processPackageConstraintS s c b' (LabeledPackageConstraint pc src) r = go pc
-- by selectively disabling choices that have been ruled out by global user
-- constraints.
enforcePackageConstraints
::
M
.
Map
PN
[
LabeledPackageConstraint
]
->
Tree
QGoalReason
->
Tree
QGoalReason
->
Tree
a
->
Tree
a
enforcePackageConstraints
pcs
=
trav
go
where
go
(
PChoiceF
qpn
@
(
Q
pp
pn
)
gr
ts
)
=
...
...
@@ -220,7 +220,7 @@ enforcePackageConstraints pcs = trav go
-- be run after user preferences have been enforced. For manual flags,
-- it checks if a user choice has been made. If not, it disables all but
-- the first choice.
enforceManualFlags
::
Tree
QGoalReason
->
Tree
QGoalReason
enforceManualFlags
::
Tree
a
->
Tree
a
enforceManualFlags
=
trav
go
where
go
(
FChoiceF
qfn
gr
tr
True
ts
)
=
FChoiceF
qfn
gr
tr
True
$
...
...
@@ -234,7 +234,7 @@ enforceManualFlags = trav go
go
x
=
x
-- | Require installed packages.
requireInstalled
::
(
PN
->
Bool
)
->
Tree
QGoalReason
->
Tree
QGoalReason
requireInstalled
::
(
PN
->
Bool
)
->
Tree
a
->
Tree
a
requireInstalled
p
=
trav
go
where
go
(
PChoiceF
v
@
(
Q
_
pn
)
gr
cs
)
...
...
@@ -258,7 +258,7 @@ requireInstalled p = trav go
-- they are, perhaps this should just result in trying to reinstall those other
-- packages as well. However, doing this all neatly in one pass would require to
-- change the builder, or at least to change the goal set after building.
avoidReinstalls
::
(
PN
->
Bool
)
->
Tree
QGoalReason
->
Tree
QGoalReason
avoidReinstalls
::
(
PN
->
Bool
)
->
Tree
a
->
Tree
a
avoidReinstalls
p
=
trav
go
where
go
(
PChoiceF
qpn
@
(
Q
_
pn
)
gr
cs
)
...
...
@@ -371,10 +371,10 @@ type EnforceSIR = Reader (Map (PI PN) QPN)
-- (that is, package name + package version) there can be at most one qualified
-- goal resolving to that instance (there may be other goals _linking_ to that
-- instance however).
enforceSingleInstanceRestriction
::
Tree
QGoalReason
->
Tree
QGoalReason
enforceSingleInstanceRestriction
::
Tree
a
->
Tree
a
enforceSingleInstanceRestriction
=
(`
runReader
`
M
.
empty
)
.
cata
go
where
go
::
TreeF
QGoalReason
(
EnforceSIR
(
Tree
QGoalReason
))
->
EnforceSIR
(
Tree
QGoalReason
)
go
::
TreeF
a
(
EnforceSIR
(
Tree
a
))
->
EnforceSIR
(
Tree
a
)
-- We just verify package choices.
go
(
PChoiceF
qpn
gr
cs
)
=
...
...
@@ -383,7 +383,7 @@ enforceSingleInstanceRestriction = (`runReader` M.empty) . cata go
innM
_otherwise
-- The check proper
goP
::
QPN
->
POption
->
EnforceSIR
(
Tree
QGoalReason
)
->
EnforceSIR
(
Tree
QGoalReason
)
goP
::
QPN
->
POption
->
EnforceSIR
(
Tree
a
)
->
EnforceSIR
(
Tree
a
)
goP
qpn
@
(
Q
_
pn
)
(
POption
i
linkedTo
)
r
=
do
let
inst
=
PI
pn
i
env
<-
ask
...
...
Write
Preview
Supports
Markdown
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