summaryrefslogtreecommitdiff
path: root/compiler/rename/RnSource.hs
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2018-11-10 01:12:52 +0100
committerBen Gamari <ben@smart-cactus.org>2019-03-22 10:34:51 -0400
commitab51bee40c82cd552bcf13e24b67d43f3b8d25f3 (patch)
treea75a4102576dad50af44e342fb9152e7270792eb /compiler/rename/RnSource.hs
parentcd07086ada34888c08585f4dc98a961618748ed0 (diff)
downloadhaskell-ab51bee40c82cd552bcf13e24b67d43f3b8d25f3.tar.gz
base: Remove `Monad(fail)` method and reexport `MonadFail(fail)` instead
As per https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail Coauthored-by: Ben Gamari <ben@well-typed.com>
Diffstat (limited to 'compiler/rename/RnSource.hs')
-rw-r--r--compiler/rename/RnSource.hs43
1 files changed, 0 insertions, 43 deletions
diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs
index 5181b7f2ed..e7ff909c02 100644
--- a/compiler/rename/RnSource.hs
+++ b/compiler/rename/RnSource.hs
@@ -43,7 +43,6 @@ import Module
import HscTypes ( Warnings(..), plusWarns )
import PrelNames ( applicativeClassName, pureAName, thenAName
, monadClassName, returnMName, thenMName
- , monadFailClassName, failMName, failMName_preMFP
, semigroupClassName, sappendName
, monoidClassName, mappendName
)
@@ -457,9 +456,6 @@ checkCanonicalInstances cls poly_ty mbinds = do
whenWOptM Opt_WarnNonCanonicalMonadInstances
checkCanonicalMonadInstances
- whenWOptM Opt_WarnNonCanonicalMonadFailInstances
- checkCanonicalMonadFailInstances
-
whenWOptM Opt_WarnNonCanonicalMonoidInstances
checkCanonicalMonoidInstances
@@ -510,45 +506,6 @@ checkCanonicalInstances cls poly_ty mbinds = do
| otherwise = return ()
- -- | Warn about unsound/non-canonical 'Monad'/'MonadFail' instance
- -- declarations. Specifically, the following conditions are verified:
- --
- -- In 'Monad' instances declarations:
- --
- -- * If 'fail' is overridden it must be canonical
- -- (i.e. @fail = Control.Monad.Fail.fail@)
- --
- -- In 'MonadFail' instance declarations:
- --
- -- * Warn if 'fail' is defined backwards
- -- (i.e. @fail = Control.Monad.fail@).
- --
- checkCanonicalMonadFailInstances
- | cls == monadFailClassName = do
- forM_ (bagToList mbinds) $ \(dL->L loc mbind) -> setSrcSpan loc $ do
- case mbind of
- FunBind { fun_id = (dL->L _ name)
- , fun_matches = mg }
- | name == failMName, isAliasMG mg == Just failMName_preMFP
- -> addWarnNonCanonicalMethod1
- Opt_WarnNonCanonicalMonadFailInstances "fail"
- "Control.Monad.fail"
-
- _ -> return ()
-
- | cls == monadClassName = do
- forM_ (bagToList mbinds) $ \(dL->L loc mbind) -> setSrcSpan loc $ do
- case mbind of
- FunBind { fun_id = (dL->L _ name)
- , fun_matches = mg }
- | name == failMName_preMFP, isAliasMG mg /= Just failMName
- -> addWarnNonCanonicalMethod2
- Opt_WarnNonCanonicalMonadFailInstances "fail"
- "Control.Monad.Fail.fail"
- _ -> return ()
-
- | otherwise = return ()
-
-- | Check whether Monoid(mappend) is defined in terms of
-- Semigroup((<>)) (and not the other way round). Specifically,
-- the following conditions are verified: