X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcSMonad.lhs;h=4d6dcdf57f3f5e60c219b8177d42dc5faa5aa9e8;hb=40be9466afba64fffeae56a042aad45d5a0cc43d;hp=5f555c5b3290fc6efd41814d3c53021a4db0cdc1;hpb=8657bb00544468adc7ad63e962af71674c3b4500;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcSMonad.lhs b/compiler/typecheck/TcSMonad.lhs index 5f555c5..4d6dcdf 100644 --- a/compiler/typecheck/TcSMonad.lhs +++ b/compiler/typecheck/TcSMonad.lhs @@ -15,7 +15,7 @@ module TcSMonad ( combineCtLoc, mkGivenFlavor, TcS, runTcS, failTcS, panicTcS, traceTcS, traceTcS0, -- Basic functionality - tryTcS, nestImplicTcS, wrapErrTcS, wrapWarnTcS, + tryTcS, nestImplicTcS, recoverTcS, wrapErrTcS, wrapWarnTcS, SimplContext(..), isInteractive, simplEqsOnly, performDefaulting, -- Creation of evidence variables @@ -145,7 +145,8 @@ data CanonicalCt -- Invariant: -- * tv not in tvs(xi) (occurs check) -- * If constraint is given then typeKind xi == typeKind tv - -- See Note [Spontaneous solving and kind compatibility] + -- See Note [Spontaneous solving and kind compatibility] + -- in TcInteract cc_id :: EvVar, cc_flavor :: CtFlavor, cc_tyvar :: TcTyVar, @@ -235,6 +236,8 @@ variable, is not canonical. Why? Hence the invariant. +The invariant is + Note [Canonical implicit parameter constraints] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The type in a canonical implicit parameter constraint doesn't need to @@ -491,6 +494,11 @@ nestImplicTcS ref untch (TcS thing_inside) in thing_inside nest_env +recoverTcS :: TcS a -> TcS a -> TcS a +recoverTcS (TcS recovery_code) (TcS thing_inside) + = TcS $ \ env -> + TcM.recoverM (recovery_code env) (thing_inside env) + ctxtUnderImplic :: SimplContext -> SimplContext -- See Note [Simplifying RULE lhs constraints] in TcSimplify ctxtUnderImplic SimplRuleLhs = SimplCheck