cardano-ledger icon indicating copy to clipboard operation
cardano-ledger copied to clipboard

Make it build with ghc-9.10

Open erikd opened this issue 1 year ago • 2 comments

Description

Make it build with ghc-9.10.

Cannot be merged until after the SRPs have been removed.

Checklist

  • [ ] Commit sequence broadly makes sense and commits have useful messages
  • [ ] New tests are added if needed and existing tests are updated
  • [ ] When applicable, versions are updated in .cabal and CHANGELOG.md files according to the versioning process.
  • [ ] The version bounds in .cabal files for all affected packages are updated. If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • [ ] All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages. New section is never added with the code changes. (See RELEASING.md)
  • [x] Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • [x] Cabal files are formatted (use scripts/cabal-format.sh)
  • [x] hie.yaml has been updated (use scripts/gen-hie.sh)
  • [ ] Self-reviewed the diff

erikd avatar Jun 27 '24 22:06 erikd

I think it would be better to make all uses of foldl' from Foldable unqualified, and where there's an ambiguity with one of the specialized versions (eg from Set) make those qualified.

Even with ghc 8.10.7, Data.List.foldl' is just a reexport of Data.Foldable.foldl', so I think we should also change all the uses of Data.List.foldl' to Data.Foldable.foldl'.

neilmayhew avatar Jul 01 '24 22:07 neilmayhew

I think it would be better to make all uses of foldl' from Foldable unqualified, and where there's an ambiguity with one of the specialized versions (eg from Set) make those qualified.

@neilmayhew The reason for qualified import is because GHC-9.10 finally exposes foldl' from Prelude, which means we run into redundant constraint issue for older ghc. So, the cleanest way to solve this is by a qualified import of Foldable

lehins avatar Jul 01 '24 22:07 lehins

I am not worried about the nix eval failure for now. I will fix it when the rest works.

erikd avatar Jul 08 '24 06:07 erikd