X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=inline;f=compiler%2Ftypecheck%2FInst.lhs;h=e175951d9517375c49fa56cd60115f7e8ea319e9;hb=0e86b6601ea17d89c7f46b3a902093d4c6020da8;hp=279ddec885b1b735525ad4366e4c87b8a58381f5;hpb=17b297d97d327620ed6bfab942f8992b2446f1bf;p=ghc-hetmet.git diff --git a/compiler/typecheck/Inst.lhs b/compiler/typecheck/Inst.lhs index 279ddec..e175951 100644 --- a/compiler/typecheck/Inst.lhs +++ b/compiler/typecheck/Inst.lhs @@ -6,11 +6,11 @@ The @Inst@ type: dictionaries or method instances \begin{code} -{-# OPTIONS_GHC -w #-} +{-# OPTIONS -w #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and fix -- any warnings in the module. See --- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings -- for details module Inst ( @@ -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.