Skip to content

Commit

Permalink
Counter fromListWith reversing constraints order
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Feb 28, 2024
1 parent 9e5e815 commit d079583
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cabal-install-solver/src/Distribution/Solver/Modular.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ modularResolver sc (Platform arch os) cinfo iidx sidx pkgConfigDB pprefs pcs pns
-- Indices have to be converted into solver-specific uniform index.
idx = convPIs os arch cinfo gcs (shadowPkgs sc) (strongFlags sc) (solveExecutables sc) iidx sidx
-- Constraints have to be converted into a finite map indexed by PN.
gcs = M.fromListWith (++) (map pair pcs)
-- Preserve the order of the constraints, countering fromListWith
-- reversing the order by using flip (++).
gcs = M.fromListWith (flip (++)) (map pair pcs)
where
pair lpc = (pcName $ unlabelPackageConstraint lpc, [lpc])

Expand Down

0 comments on commit d079583

Please sign in to comment.