Remove redundant constraints#11814
Conversation
3ee0590 to
30ae160
Compare
ulysses4ever
left a comment
There was a problem hiding this comment.
A little scary how big it is. It'd be great if all of it was trivial (like replacing Semigroup m, Monoid m with Monoid m). The one thing I'm truly unsure of is FieldGrammar: it'd be good to document why it's okay to remove those.
|
On the master branch, for building Cabal's packages, sampling important
From
From
So we're safe to remove |
|
I'd not bother touching The rest seems fine and safe to remove. |
|
@Bodigrim That's a reasonable concern. I can put |
30ae160 to
f029341
Compare
Add -Wredundant-constraints ghc flag to ghc-optionss.config.
HasVerbosity, HasCallStack and WithCallStack constraints are not
touched. -Wno-redundant-constraints is added for these modules
FieldGrammar allows instances to specify a constraint that its methods
should follow. ParsecFieldGrammar is an instance of FieldGrammar
(when using the grammar as a parser) that c is instantiated as Parsec;
PrettyFieldGrammar is also an instance of FieldGrammar (when using
the grammar as a printer) that c is instantiated as Pretty.
With that in mind:
For ParsecFieldGrammar, Parsec (List FSep Token String) holds.
For PrettyFieldGrammar, Pretty (List Fsep Token String) holds.
I removed this and all tests still pass, so this constraint is not
needed (i.e. we actually don't need to parse or print a List FSep Token
String).
f029341 to
ae60693
Compare
|
CI is green. The only thing left is a merge label. |
There are quite some constraints that are not needed, so we remove them.
I added the flag to each of the packages that got this warning, except test packages.
TODO (for me) :
Template B: This PR does not modify behaviour or interface
E.g. the PR only touches documentation or tests, does refactorings, etc.
Include the following checklist in your PR: