diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2015-11-24 12:46:33 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2015-11-24 12:47:39 +0100 |
commit | f09f2470a76bb08b7f51d2f5663daa672b86f618 (patch) | |
tree | c1caef650e832d4f868ba6260ca4a452dccbc353 /testsuite/tests/module | |
parent | 12dbc89228d9a13c011e4f399db1bdc0fa4681f0 (diff) | |
download | haskell-f09f2470a76bb08b7f51d2f5663daa672b86f618.tar.gz |
Implement new `-fwarn-noncanonical-monad-instances`
Warn about incoherent/non-canonical 'Applicative'/'Monad' instance
declarations. Specifically the following invariants are checked:
In 'Monad' instances declarations warn if the any of the following
conditions does not hold:
* If `return` is overridden it must be canonical (i.e. `return = pure`).
* If `(>>)` is overridden it must be canonical (i.e. `(>>) = (*>)`).
In 'Applicative' instance declarations:
* Warn if 'pure' is defined backwards (i.e. `pure = return`).
* Warn if '(*>)' is defined backwards (i.e. `(*>) = (>>)`).
NB, this warning flag is not enabled via `-Wall` nor `-Wcompat`.
This addresses #11128
Reviewers: quchen, austin, bgamari
Reviewed By: bgamari
Differential Revision: https://phabricator.haskell.org/D1516
Diffstat (limited to 'testsuite/tests/module')
0 files changed, 0 insertions, 0 deletions