Turn on MonadFail desugaring by default
authorHerbert Valerio Riedel <hvr@gnu.org>
Mon, 6 Aug 2018 16:59:40 +0000 (12:59 -0400)
committerBen Gamari <ben@smart-cactus.org>
Mon, 6 Aug 2018 22:23:35 +0000 (18:23 -0400)
commit26b6ffb3d5a66dc821635cdca8d9ce8dc2960c35
treec328b69a9209f5602dfebc254f0b4a788ca999a1
parent751febe4fb3ab8b5fa328795929854acebe07922
Turn on MonadFail desugaring by default

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#Transitiona
lstrategy

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