summaryrefslogtreecommitdiff
path: root/compiler/rename
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2018-08-06 12:53:06 -0400
committerBen Gamari <ben@smart-cactus.org>2018-08-07 15:56:53 -0400
commitaab8656ba0561e56048a1222c396d2d117aca5a7 (patch)
tree8d14345e7f042ba5700b4275950e44dcc0ca1be9 /compiler/rename
parentf22baa424aed66cd75ea05d4db7efdcd0e021217 (diff)
downloadhaskell-aab8656ba0561e56048a1222c396d2d117aca5a7.tar.gz
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
Diffstat (limited to 'compiler/rename')
-rw-r--r--compiler/rename/RnNames.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs
index 8d3f1835ae..cf4c258d01 100644
--- a/compiler/rename/RnNames.hs
+++ b/compiler/rename/RnNames.hs
@@ -997,9 +997,13 @@ filterImports iface decl_spec (Just (want_hiding, L l import_items))
IEThingWith xt ltc@(L l rdr_tc) wc rdr_ns rdr_fs ->
ASSERT2(null rdr_fs, ppr rdr_fs) do
- (name, AvailTC _ ns subflds, mb_parent)
+ (name, avail, mb_parent)
<- lookup_name (IEThingAbs noExt ltc) (ieWrappedName rdr_tc)
+ let (ns,subflds) = case avail of
+ AvailTC _ ns' subflds' -> (ns',subflds')
+ Avail _ -> panic "filterImports"
+
-- Look up the children in the sub-names of the parent
let subnames = case ns of -- The tc is first in ns,
[] -> [] -- if it is there at all