diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2017-09-09 16:29:23 +0200 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2017-09-09 16:43:36 +0200 |
commit | 346e562adffd44edd8c31328c0280543d7dd75c1 (patch) | |
tree | e10042e1640a8ad944c86d8590c45bb02254d2f6 /compiler/prelude | |
parent | dab0e515eadecaee3e9e9f5f8eee3159fa39bb27 (diff) | |
download | haskell-346e562adffd44edd8c31328c0280543d7dd75c1.tar.gz |
Canonicalise MonoidFail instances in GHC
IOW, code compiles -Wnoncanonical-monoidfail-instances clean now
This is easy now since we require GHC 8.0/base-4.9 or later
for bootstrapping.
Note that we can easily enable `MonadFail` via
default-extensions: MonadFailDesugaring
in compiler/ghc.cabal.in
which currently would point out that NatM doesn't have
a proper `fail` method, even though failable patterns
are made use of:
compiler/nativeGen/SPARC/CodeGen.hs:425:25: error:
* No instance for (Control.Monad.Fail.MonadFail NatM)
arising from a do statement
with the failable pattern ‘(dyn_c, [dyn_r])’
Diffstat (limited to 'compiler/prelude')
-rw-r--r-- | compiler/prelude/PrelRules.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/prelude/PrelRules.hs b/compiler/prelude/PrelRules.hs index 13f4f12736..d2b8d875b2 100644 --- a/compiler/prelude/PrelRules.hs +++ b/compiler/prelude/PrelRules.hs @@ -647,7 +647,7 @@ instance Monad RuleM where RuleM f >>= g = RuleM $ \dflags iu e -> case f dflags iu e of Nothing -> Nothing Just r -> runRuleM (g r) dflags iu e - fail _ = mzero + fail = MonadFail.fail instance MonadFail.MonadFail RuleM where fail _ = mzero |