... |
... |
@@ -247,11 +247,11 @@ tryUnsatisfiableGivens wc = |
247
|
247
|
; solveAgainIf did_work final_wc }
|
248
|
248
|
where
|
249
|
249
|
go_wc (WC { wc_simple = wtds, wc_impl = impls, wc_errors = errs })
|
250
|
|
- = do impls' <- mapMaybeBagM go_impl impls
|
|
250
|
+ = do impls' <- mapBagM go_impl impls
|
251
|
251
|
return $ WC { wc_simple = wtds, wc_impl = impls', wc_errors = errs }
|
252
|
252
|
go_impl impl
|
253
|
253
|
| isSolvedStatus (ic_status impl)
|
254
|
|
- = return $ Just impl
|
|
254
|
+ = return impl
|
255
|
255
|
-- Is there a Given with type "Unsatisfiable msg"?
|
256
|
256
|
-- If so, use it to solve all other Wanteds.
|
257
|
257
|
| unsat_given:_ <- mapMaybe unsatisfiableEv_maybe (ic_given impl)
|
... |
... |
@@ -271,7 +271,7 @@ unsatisfiableEv_maybe v = (v,) <$> isUnsatisfiableCt_maybe (idType v) |
271
|
271
|
-- | We have an implication with an 'Unsatisfiable' Given; use that Given to
|
272
|
272
|
-- solve all the other Wanted constraints, including those nested within
|
273
|
273
|
-- deeper implications.
|
274
|
|
-solveImplicationUsingUnsatGiven :: (EvVar, Type) -> Implication -> TcS (Maybe Implication)
|
|
274
|
+solveImplicationUsingUnsatGiven :: (EvVar, Type) -> Implication -> TcS Implication
|
275
|
275
|
solveImplicationUsingUnsatGiven
|
276
|
276
|
unsat_given@(given_ev,_)
|
277
|
277
|
impl@(Implic { ic_wanted = wtd, ic_tclvl = tclvl, ic_binds = ev_binds_var
|
... |
... |
@@ -279,7 +279,7 @@ solveImplicationUsingUnsatGiven |
279
|
279
|
| isCoEvBindsVar ev_binds_var
|
280
|
280
|
-- We can't use Unsatisfiable evidence in kinds.
|
281
|
281
|
-- See Note [Coercion evidence only] in GHC.Tc.Types.Evidence.
|
282
|
|
- = return $ Just impl
|
|
282
|
+ = return impl
|
283
|
283
|
| otherwise
|
284
|
284
|
= do { wcs <- nestImplicTcS ev_binds_var tclvl $ go_wc wtd
|
285
|
285
|
; setImplicationStatus $
|
... |
... |
@@ -290,7 +290,7 @@ solveImplicationUsingUnsatGiven |
290
|
290
|
go_wc :: WantedConstraints -> TcS WantedConstraints
|
291
|
291
|
go_wc wc@(WC { wc_simple = wtds, wc_impl = impls })
|
292
|
292
|
= do { mapBagM_ go_simple wtds
|
293
|
|
- ; impls <- mapMaybeBagM (solveImplicationUsingUnsatGiven unsat_given) impls
|
|
293
|
+ ; impls <- mapBagM (solveImplicationUsingUnsatGiven unsat_given) impls
|
294
|
294
|
; return $ wc { wc_simple = emptyBag, wc_impl = impls } }
|
295
|
295
|
go_simple :: Ct -> TcS ()
|
296
|
296
|
go_simple ct = case ctEvidence ct of
|