X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypes%2FFunDeps.lhs;h=0bea32fe57b124df03882711e3d6a6e45471b410;hp=02b0a2ab0522f31a1ef251eee576acdee7e803f3;hb=d2ce0f52d42edf32bb9f13796e6ba6edba8bd516;hpb=0084ab49ab3c0123c4b7f9523d092af45bccfd41 diff --git a/compiler/types/FunDeps.lhs b/compiler/types/FunDeps.lhs index 02b0a2a..0bea32f 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,21 @@ 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