Commit 6252b70a authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

A small, local refactoring of TcSimplify.usefulToFloat

parent f79b9ec9
......@@ -1760,12 +1760,12 @@ floatEqualities skols no_given_eqs
, wanteds { wc_simple = remaining_simples } ) }
where
skol_set = mkVarSet skols
(float_eqs, remaining_simples) = partitionBag (usefulToFloat is_useful) simples
is_useful pred = tyCoVarsOfType pred `disjointVarSet` skol_set
(float_eqs, remaining_simples) = partitionBag (usefulToFloat skol_set) simples
usefulToFloat :: (TcPredType -> Bool) -> Ct -> Bool
usefulToFloat is_useful_pred ct -- The constraint is un-flattened and de-canonicalised
= is_meta_var_eq pred && is_useful_pred pred
usefulToFloat :: VarSet -> Ct -> Bool
usefulToFloat skol_set ct -- The constraint is un-flattened and de-canonicalised
= is_meta_var_eq pred &&
(tyCoVarsOfType pred `disjointVarSet` skol_set)
where
pred = ctPred ct
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment