[GHC] #11150: New `-fwarn-noncanonical-monoid-instances` warning
#11150: New `-fwarn-noncanonical-monoid-instances` warning -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature | Status: new request | Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: #11128, #11139 Differential Rev(s): | Wiki Page: | prime:Libraries/Proposals/SemigroupMonoid -------------------------------------+------------------------------------- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11150> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11150: New `-fwarn-noncanonical-monoid-instances` warning -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: patch Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11128, #11139 | Differential Rev(s): Phab:D1553 Wiki Page: | prime:Libraries/Proposals/SemigroupMonoid| -------------------------------------+------------------------------------- Changes (by hvr): * status: new => patch * cc: ekmett, quchen (added) * differential: => Phab:D1553 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11150#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11150: New `-fwarn-noncanonical-monoid-instances` warning -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: patch Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11128, #11139 | Differential Rev(s): Phab:D1553 Wiki Page: | prime:Libraries/Proposals/SemigroupMonoid| -------------------------------------+------------------------------------- Comment (by Herbert Valerio Riedel <hvr@…>): In [changeset:"986ceb1679b501414b996c520b08ce929a40f94c/ghc" 986ceb16/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="986ceb1679b501414b996c520b08ce929a40f94c" Implement new `-fwarn-noncanonical-monoid-instances` This is similiar to the `-fwarn-noncanonical-monad-instances` warning implemented via #11128, but applies to `Semigroup`/`Monoid` instead and the `(<>)`/`mappend` methods (of which `mappend` is planned to move out of `Monoid` at some point in the future being redundant and thus error-prone). This warning is contained in `-Wcompat` but not in `-Wall`. This addresses #11150 Reviewed By: quchen Differential Revision: https://phabricator.haskell.org/D1553 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11150#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11150: New `-fwarn-noncanonical-monoid-instances` warning -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11128, #11139 | Differential Rev(s): Phab:D1553 Wiki Page: | prime:Libraries/Proposals/SemigroupMonoid| -------------------------------------+------------------------------------- Changes (by hvr): * status: patch => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11150#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11150: New `-fwarn-noncanonical-monoid-instances` warning -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11128, #11139 | Differential Rev(s): Phab:D1553 Wiki Page: | prime:Libraries/Proposals/SemigroupMonoid| -------------------------------------+------------------------------------- Comment (by Herbert Valerio Riedel <hvr@…>): In [changeset:"fd6dd41c67f3bd23bbf074357219cfd251eb53d6/ghc" fd6dd41c/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="fd6dd41c67f3bd23bbf074357219cfd251eb53d6" Implement `-Wnoncanonical-monadfail-instances` warning The MonadFail proposal implemented so far via #10751 only warns about missing `MonadFail` instances based on existence of failible pattern matches in `do`-blocks. However, based on the noncanonical Monad warnings implemented via #11150 we can provide a different mechanism for detecting missing `MonadFail` instances quite cheaply. That is, by checking for canonical `fail` definitions. In the case of `Monad`/`MonadFail`, we define the canonical implementation of `fail` to be such that the soft-deprecated method shall (iff overridden) be defined in terms of the non-deprecated method. Consequently, in case of `MonadFail`, the `Monad(fail)` method shall be defined as alias of the `MonadFail(fail)` method. This allows us at some distant point in the future to remove `fail` from the `Monad` class, while having GHC ignore/tolerate such literal canonical method definitions. Reviewed By: bgamari, RyanGlScott Differential Revision: https://phabricator.haskell.org/D1838 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11150#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC