Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
8421806d
Commit
8421806d
authored
8 years ago
by
kristenk
Browse files
Options
Downloads
Patches
Plain Diff
Replace a call to 'foldProgress'.
parent
beb51061
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cabal-install/Distribution/Solver/Modular/Explore.hs
+3
-5
3 additions, 5 deletions
cabal-install/Distribution/Solver/Modular/Explore.hs
cabal-install/Distribution/Solver/Modular/RetryLog.hs
+7
-0
7 additions, 0 deletions
cabal-install/Distribution/Solver/Modular/RetryLog.hs
with
10 additions
and
5 deletions
cabal-install/Distribution/Solver/Modular/Explore.hs
+
3
−
5
View file @
8421806d
...
...
@@ -18,7 +18,6 @@ import Distribution.Solver.Modular.RetryLog
import
Distribution.Solver.Modular.Tree
import
Distribution.Solver.Types.PackagePath
import
Distribution.Solver.Types.Settings
(
EnableBackjumping
(
..
),
CountConflicts
(
..
))
import
qualified
Distribution.Solver.Types.Progress
as
P
-- | This function takes the variable we're currently considering, an
-- initial conflict set and a
...
...
@@ -165,8 +164,7 @@ backjumpAndExplore :: EnableBackjumping
->
CountConflicts
->
Tree
QGoalReason
->
Log
Message
(
Assignment
,
RevDepMap
)
backjumpAndExplore
enableBj
countConflicts
t
=
toLog
$
toProgress
$
exploreLog
enableBj
countConflicts
t
(
A
M
.
empty
M
.
empty
M
.
empty
)
M
.
empty
toLog
$
exploreLog
enableBj
countConflicts
t
(
A
M
.
empty
M
.
empty
M
.
empty
)
M
.
empty
where
toLog
::
P
.
Progress
step
fail
done
->
Log
step
done
toLog
=
P
.
fold
Progress
P
.
Step
(
const
(
P
.
Fail
()
))
P
.
Done
toLog
::
RetryLog
step
fail
done
->
Log
step
done
toLog
=
to
Progress
.
mapFailure
(
const
()
)
This diff is collapsed.
Click to expand it.
cabal-install/Distribution/Solver/Modular/RetryLog.hs
+
7
−
0
View file @
8421806d
...
...
@@ -3,6 +3,7 @@ module Distribution.Solver.Modular.RetryLog
(
RetryLog
,
toProgress
,
fromProgress
,
mapFailure
,
retry
,
failWith
,
succeedWith
...
...
@@ -34,6 +35,12 @@ fromProgress l = RetryLog $ \f -> go f l
go
f
(
Fail
failure
)
=
f
failure
go
f
(
Step
m
ms
)
=
Step
m
(
go
f
ms
)
-- | /O(1)/. Apply a function to the failure value in a log.
mapFailure
::
(
fail1
->
fail2
)
->
RetryLog
step
fail1
done
->
RetryLog
step
fail2
done
mapFailure
f
l
=
retry
l
$
\
failure
->
RetryLog
$
\
g
->
g
(
f
failure
)
-- | /O(1)/. If the first log leads to failure, continue with the second.
retry
::
RetryLog
step
fail1
done
->
(
fail1
->
RetryLog
step
fail2
done
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment