Extend hptInstances to also cover family instances
[ghc-hetmet.git] / compiler / simplCore / Simplify.lhs
index 25dc2ba..aab8925 100644 (file)
@@ -17,8 +17,7 @@ import Id
 import Var
 import IdInfo
 import Coercion
-import DataCon         ( dataConTyCon, dataConRepStrictness, dataConUnivTyVars )
-import TyCon           ( tyConArity )
+import DataCon         ( dataConRepStrictness, dataConUnivTyVars )
 import CoreSyn
 import NewDemand       ( isStrictDmd )
 import PprCore         ( pprParendExpr, pprCoreExpr )
@@ -968,7 +967,7 @@ completeCall env var cont
        -- So it's up to the programmer: rules can cause divergence
        ; let   in_scope   = getInScope env
                rules      = getRules env
-               maybe_rule = case activeRule env of
+               maybe_rule = case activeRule dflags env of
                                Nothing     -> Nothing  -- No rules apply
                                Just act_fn -> lookupRule act_fn in_scope 
                                                          rules var args 
@@ -1165,6 +1164,9 @@ rebuildCase env scrut case_bndr [(con,bndrs,rhs)] cont
        -- The case binder is going to be evaluated later, 
        -- and the scrutinee is a simple variable
     var_demanded_later (Var v) = isStrictDmd (idNewDemandInfo case_bndr)
+                                && not (isTickBoxOp v) 
+                                   -- ugly hack; covering this case is what 
+                                   -- exprOkForSpeculation was intended for.
     var_demanded_later other   = False