X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcDeriv.lhs;h=90ff3a7c8c1611ec906ca4f307294161fb75f1fe;hb=2423c249f5ca7785d0ec89eb33e72662da7561c1;hp=68c5173be2ea3f4d65eab197b7421ea57e748f72;hpb=49c98d143c382a1341e1046f5ca00819a25691ba;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcDeriv.lhs b/compiler/typecheck/TcDeriv.lhs index 68c5173..90ff3a7 100644 --- a/compiler/typecheck/TcDeriv.lhs +++ b/compiler/typecheck/TcDeriv.lhs @@ -15,7 +15,6 @@ import DynFlags import Generics import TcRnMonad -import TcMType import TcEnv import TcGenDeriv -- Deriv stuff import InstEnv @@ -763,9 +762,10 @@ solveDerivEqns overlap_flag orig_eqns do { let inst_tys = [mkTyConApp tc (mkTyVarTys tyvars)] ; theta <- addErrCtxt (derivInstCtxt1 clas inst_tys) $ tcSimplifyDeriv orig tc tyvars deriv_rhs - ; addErrCtxt (derivInstCtxt2 theta clas inst_tys) $ - checkValidInstance tyvars theta clas inst_tys - ; return (sortLe (<=) theta) } -- Canonicalise before returning the soluction + -- Claim: the result instance declaration is guaranteed valid + -- Hence no need to call: + -- checkValidInstance tyvars theta clas inst_tys + ; return (sortLe (<=) theta) } -- Canonicalise before returning the solution where @@ -995,10 +995,5 @@ derivCtxt tycon derivInstCtxt1 clas inst_tys = ptext SLIT("When deriving the instance for") <+> quotes (pprClassPred clas inst_tys) - -derivInstCtxt2 theta clas inst_tys - = vcat [ptext SLIT("In the derived instance declaration"), - nest 2 (ptext SLIT("instance") <+> sep [pprThetaArrow theta, - pprClassPred clas inst_tys])] \end{code}