Turn on MonadFail desugaring by default
authorHerbert Valerio Riedel <hvr@gnu.org>
Mon, 6 Aug 2018 16:53:06 +0000 (12:53 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 7 Aug 2018 19:56:53 +0000 (15:56 -0400)
commitaab8656ba0561e56048a1222c396d2d117aca5a7
tree8d14345e7f042ba5700b4275950e44dcc0ca1be9
parentf22baa424aed66cd75ea05d4db7efdcd0e021217
Turn on MonadFail desugaring by default

Summary:
This contains two commits:

----

Make GHC's code-base compatible w/ `MonadFail`

There were a couple of use-sites which implicitly used pattern-matches
in `do`-notation even though the underlying `Monad` didn't explicitly
support `fail`

This refactoring turns those use-sites into explicit case
discrimations and adds an `MonadFail` instance for `UniqSM`
(`UniqSM` was the worst offender so this has been postponed for a
follow-up refactoring)

---

Turn on MonadFail desugaring by default

This finally implements the phase scheduled for GHC 8.6 according to

https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail#Transitionalstrategy

This also preserves some tests that assumed MonadFail desugaring to be
active; all ghc boot libs were already made compatible with this
`MonadFail` long ago, so no changes were needed there.

Test Plan: Locally performed ./validate --fast

Reviewers: bgamari, simonmar, jrtc27, RyanGlScott

Reviewed By: bgamari

Subscribers: bgamari, RyanGlScott, rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D5028
28 files changed:
compiler/basicTypes/UniqSupply.hs
compiler/codeGen/StgCmmCon.hs
compiler/codeGen/StgCmmMonad.hs
compiler/codeGen/StgCmmPrim.hs
compiler/coreSyn/MkCore.hs
compiler/deSugar/Coverage.hs
compiler/ghci/ByteCodeAsm.hs
compiler/ghci/RtClosureInspect.hs
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
compiler/main/DynFlags.hs
compiler/main/InteractiveEval.hs
compiler/nativeGen/SPARC/CodeGen.hs
compiler/rename/RnNames.hs
compiler/typecheck/TcGenFunctor.hs
docs/users_guide/8.6.1-notes.rst
docs/users_guide/glasgow_exts.rst
ghc/GHCi/UI.hs
testsuite/tests/annotations/should_run/annrun01.hs
testsuite/tests/deSugar/should_run/dsrun010.hs
testsuite/tests/determinism/determ017/A.hs
testsuite/tests/monadfail/MonadFailWarnings.hs
testsuite/tests/monadfail/MonadFailWarningsDisabled.hs
testsuite/tests/rebindable/rebindable1.hs
testsuite/tests/simplCore/should_run/T3591.hs
testsuite/tests/wcompat-warnings/WCompatWarningsNotOn.hs
testsuite/tests/wcompat-warnings/WCompatWarningsOff.hs
testsuite/tests/wcompat-warnings/WCompatWarningsOn.hs
testsuite/tests/wcompat-warnings/WCompatWarningsOnOff.hs