Skip to content

Commit d079583

Browse files
committed
Counter fromListWith reversing constraints order
1 parent 9e5e815 commit d079583

File tree

1 file changed

+3
-1
lines changed
  • cabal-install-solver/src/Distribution/Solver

1 file changed

+3
-1
lines changed

cabal-install-solver/src/Distribution/Solver/Modular.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ modularResolver sc (Platform arch os) cinfo iidx sidx pkgConfigDB pprefs pcs pns
6666
-- Indices have to be converted into solver-specific uniform index.
6767
idx = convPIs os arch cinfo gcs (shadowPkgs sc) (strongFlags sc) (solveExecutables sc) iidx sidx
6868
-- Constraints have to be converted into a finite map indexed by PN.
69-
gcs = M.fromListWith (++) (map pair pcs)
69+
-- Preserve the order of the constraints, countering fromListWith
70+
-- reversing the order by using flip (++).
71+
gcs = M.fromListWith (flip (++)) (map pair pcs)
7072
where
7173
pair lpc = (pcName $ unlabelPackageConstraint lpc, [lpc])
7274

0 commit comments

Comments
 (0)