X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypes%2FFunDeps.lhs;h=511472c66c7b5f823e9012f9898402e00c8ac4d4;hb=a46bdb63d919da9478bcd1bee2933dc19bc174ab;hp=02b0a2ab0522f31a1ef251eee576acdee7e803f3;hpb=e5a8d57c85d42007c8cc561e6d6b805c23603fc0;p=ghc-hetmet.git diff --git a/compiler/types/FunDeps.lhs b/compiler/types/FunDeps.lhs index 02b0a2a..511472c 100644 --- a/compiler/types/FunDeps.lhs +++ b/compiler/types/FunDeps.lhs @@ -9,8 +9,8 @@ It's better to read it as: "if we know these, then we're going to know these" \begin{code} module FunDeps ( - Equation, pprEquation, - oclose, improveOne, + Equation, pprEquation, + oclose, improveFromInstEnv, improveFromAnother, checkInstCoverage, checkFunDeps, pprFundeps ) where @@ -200,6 +200,22 @@ NOTA BENE: \begin{code} type Pred_Loc = (PredType, SDoc) -- SDoc says where the Pred comes from +improveFromInstEnv :: (Class -> [Instance]) + -> Pred_Loc + -> [(Equation,Pred_Loc,Pred_Loc)] +-- Improvement from top-level instances +improveFromInstEnv _inst_env pred + = improveOne _inst_env pred [] -- TODO: Refactor to directly use instance_eqnd? + + +improveFromAnother :: Pred_Loc + -> Pred_Loc + -> [(Equation, Pred_Loc, Pred_Loc)] +-- Improvement from another local (given or wanted) constraint +improveFromAnother pred1 pred2 + = improveOne (\_ -> []) pred1 [pred2] -- TODO: Refactor to directly use pairwise_eqns? + + improveOne :: (Class -> [Instance]) -- Gives instances for given class -> Pred_Loc -- Do improvement triggered by this -> [Pred_Loc] -- Current constraints