X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FInst.lhs;h=e175951d9517375c49fa56cd60115f7e8ea319e9;hb=25f84fa7e4b84c3db5ba745a7881c009b778e0b1;hp=8d21d1bcb190b8973b99d40035e75f5c8e8a7b94;hpb=7fc749a43b4b6b85d234fa95d4928648259584f4;p=ghc-hetmet.git diff --git a/compiler/typecheck/Inst.lhs b/compiler/typecheck/Inst.lhs index 8d21d1b..e175951 100644 --- a/compiler/typecheck/Inst.lhs +++ b/compiler/typecheck/Inst.lhs @@ -48,7 +48,7 @@ module Inst ( mkWantedCo, mkGivenCo, fromWantedCo, fromGivenCo, - eitherEqInst, mkEqInst, mkEqInsts, + eitherEqInst, mkEqInst, mkEqInsts, mkWantedEqInst, finalizeEqInst, writeWantedCoercion, eqInstType, updateEqInstCoercion, eqInstCoercion, @@ -1004,6 +1004,12 @@ mkEqInst (EqPred ty1 ty2) co } where mkName uniq src_span = mkInternalName uniq (mkVarOcc "co") src_span +mkWantedEqInst :: PredType -> TcM Inst +mkWantedEqInst pred@(EqPred ty1 ty2) + = do { cotv <- newMetaTyVar TauTv (mkCoKind ty1 ty2) + ; mkEqInst pred (Left cotv) + } + -- type inference: -- We want to promote the wanted EqInst to a given EqInst -- in the signature context.