[commit: ghc] master: A small, local refactoring of TcSimplify.usefulToFloat (6252b70)

git at git.haskell.org git at git.haskell.org
Mon Feb 8 15:07:54 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6252b70a2fc61ff90c7abc93d2e9f05cf60ab47e/ghc

>---------------------------------------------------------------

commit 6252b70a2fc61ff90c7abc93d2e9f05cf60ab47e
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Feb 8 13:38:09 2016 +0000

    A small, local refactoring of TcSimplify.usefulToFloat


>---------------------------------------------------------------

6252b70a2fc61ff90c7abc93d2e9f05cf60ab47e
 compiler/typecheck/TcSimplify.hs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs
index 8a57877..b992ef7 100644
--- a/compiler/typecheck/TcSimplify.hs
+++ b/compiler/typecheck/TcSimplify.hs
@@ -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
 



More information about the ghc-commits mailing list