Canonicalise MonoidFail instances in GHC
authorHerbert Valerio Riedel <hvr@gnu.org>
Sat, 9 Sep 2017 14:29:23 +0000 (16:29 +0200)
committerHerbert Valerio Riedel <hvr@gnu.org>
Sat, 9 Sep 2017 14:43:36 +0000 (16:43 +0200)
commit346e562adffd44edd8c31328c0280543d7dd75c1
treee10042e1640a8ad944c86d8590c45bb02254d2f6
parentdab0e515eadecaee3e9e9f5f8eee3159fa39bb27
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])’
12 files changed:
compiler/cmm/CmmMonad.hs
compiler/coreSyn/CoreLint.hs
compiler/ghc.cabal.in
compiler/parser/Lexer.x
compiler/prelude/PrelRules.hs
compiler/specialise/Specialise.hs
compiler/typecheck/TcRnTypes.hs
compiler/typecheck/TcSMonad.hs
compiler/types/Unify.hs
compiler/utils/IOEnv.hs
compiler/utils/ListT.hs
ghc/ghc-bin.cabal.in