refactor(cabal-install, cabal-install-solver): avoid using "error" in validateSolverResult#11650
Open
andreabedini wants to merge 1 commit intohaskell:masterfrom
Open
refactor(cabal-install, cabal-install-solver): avoid using "error" in validateSolverResult#11650andreabedini wants to merge 1 commit intohaskell:masterfrom
andreabedini wants to merge 1 commit intohaskell:masterfrom
Conversation
geekosaur
approved these changes
Mar 24, 2026
Bodigrim
approved these changes
Mar 25, 2026
sebright
approved these changes
Mar 25, 2026
60fbac8 to
d153f06
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the dependency-solver result validation path to avoid throwing uncatchable exceptions (error) by integrating validation into the Progress monad chain, enabling structured failure (Fail) instead.
Changes:
- Add a
stephelper and aMonadFailinstance forProgress(String failures). - Refactor
resolveDependencies/validateSolverResultto usedo-notation andfailinstead oferror. - Adjust unit tests to avoid name collisions with the new
stephelper.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cabal-install/tests/UnitTests/Distribution/Solver/Modular/RetryLog.hs | Renames test lambda variables to avoid clashing with newly introduced step. |
| cabal-install/src/Distribution/Client/Dependency.hs | Converts validation from error to Progress failure and threads it through the Progress chain. |
| cabal-install-solver/src/Distribution/Solver/Types/Progress.hs | Adds step helper and MonadFail instance to support structured failure in Progress. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8896dc1 to
4a4c61a
Compare
… validateSolverResult - Add a `step` helper and a `MonadFail` instance to `Progress` - Refactor `validateSolverResult` to integrate into the `Progress` monad chain using `fail` instead of `error`, giving structured failure instead of an uncatchable exception
4a4c61a to
75e24eb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
stephelper and aMonadFailinstance toProgressvalidateSolverResultto integrate into theProgressmonad chainusing
failinstead oferror, giving structured failure instead of anuncatchable exception