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
75abc8a9
Commit
75abc8a9
authored
Jan 02, 2017
by
kristenk
Committed by
GitHub
Jan 02, 2017
Browse files
Merge pull request #4204 from grayjay/cycle-detection-comments
Add a comment to 'Distribution.Solver.Modular.Cycles.findCycles'.
parents
efe1b211
4cd0d375
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Solver/Modular/Cycles.hs
View file @
75abc8a9
...
@@ -56,10 +56,11 @@ findCycles pkg rdm =
...
@@ -56,10 +56,11 @@ findCycles pkg rdm =
-- step and a slower calculation of the conflict set.
-- step and a slower calculation of the conflict set.
--
--
-- 'hasCycle' checks for cycles incrementally by only looking for cycles
-- 'hasCycle' checks for cycles incrementally by only looking for cycles
-- containing the current package. It searches for cycles in the 'RevDepMap',
-- containing the current package, 'pkg'. It searches for cycles in the
-- which is the data structure used to store reverse dependencies in the
-- 'RevDepMap', which is the data structure used to store reverse
-- search tree. We store the reverse dependencies in a map, because Data.Map
-- dependencies in the search tree. We store the reverse dependencies in a
-- is smaller and/or has better sharing than Distribution.Compat.Graph.
-- map, because Data.Map is smaller and/or has better sharing than
-- Distribution.Compat.Graph.
--
--
-- If there is a cycle, we call G.cycles to find a strongly connected
-- If there is a cycle, we call G.cycles to find a strongly connected
-- component. Then we choose one cycle from the component to use for the
-- component. Then we choose one cycle from the component to use for the
...
@@ -79,6 +80,7 @@ findCycles pkg rdm =
...
@@ -79,6 +80,7 @@ findCycles pkg rdm =
Just
(
n
:
_
)
->
G
.
nodeKey
n
Just
(
n
:
_
)
->
G
.
nodeKey
n
_
->
findCyclesError
"cannot find next node in the cycle"
_
->
findCyclesError
"cannot find next node in the cycle"
-- This function also assumes that all cycles contain 'pkg'.
oneCycle
::
[
QPN
]
oneCycle
::
[
QPN
]
oneCycle
=
case
iterate
next
pkg
of
oneCycle
=
case
iterate
next
pkg
of
[]
->
findCyclesError
"empty cycle"
[]
->
findCyclesError
"empty cycle"
...
...
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