Closed fabianhjr closed 3 years ago
Thank you for the patch. What happened to Semigroup/Monoid in that version? Strangely, the changelog for base doesn't say anything about that.
It was promoted to a warn pointing to this doc: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/semigroup-monoid
Example:
Test/Tasty/Options.hs:103:3: warning: [-Wnoncanonical-monoid-instances]
Noncanonical ‘mappend’ definition detected
in the instance declaration for ‘Monoid OptionSet’.
‘mappend’ will eventually be removed in favour of ‘(<>)’
Either remove definition for ‘mappend’ (recommended) or define as ‘mappend = (<>)’
See also: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/semigroup-monoid
|
103 | OptionSet a `mappend` OptionSet b =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
Split into two commits.
Got it, thanks. It seems to me though that too much code is inside CPP ifs right now. Could you refactor it so that only mappend's definition is conditional, like in that wiki page? This should make the code easier to understand and modify if needed.
Done, there are 3 new warnings that only appear on 9.2 and all current (8.0 - 9.0) pass with no new warnings.
https://github.com/LibreCybernetics/tasty/actions/runs/1481646589
Merged, thank you!
Tested locally on NixOS x86_64 using the following change on
stack.yaml
:Result (abbreviated):
Doing a
cabal build all
also completed successfully. :3