add -fsimpleopt-before-flatten
[ghc-hetmet.git] / compiler / types / OptCoercion.lhs
index 0fff7ab..26f3295 100644 (file)
@@ -19,6 +19,7 @@ import Var
 import VarSet\r
 import VarEnv\r
 import PrelNames\r
+import StaticFlags     ( opt_NoOptCoercion )\r
 import Util\r
 import Outputable\r
 \end{code}\r
@@ -50,7 +51,9 @@ mkCoPredTy in the ForAll case, where this note appears.
 optCoercion :: TvSubst -> Coercion -> NormalCo\r
 -- ^ optCoercion applies a substitution to a coercion, \r
 --   *and* optimises it to reduce its size\r
-optCoercion env co = opt_co env False co\r
+optCoercion env co \r
+  | opt_NoOptCoercion = substTy env co\r
+  | otherwise         = opt_co env False co\r
 \r
 type NormalCo = Coercion\r
   -- Invariants: \r