FIX: mkWWcpr takes open alg types into account
[ghc-hetmet.git] / compiler / stranal / WwLib.lhs
index 7b88ab2..d066f44 100644 (file)
@@ -4,11 +4,11 @@
 \section[WwLib]{A library for the ``worker/wrapper'' back-end to the strictness analyser}
 
 \begin{code}
-{-# OPTIONS_GHC -w #-}
+{-# OPTIONS -w #-}
 -- The above warning supression flag is a temporary kludge.
 -- While working on this module you are encouraged to remove it and fix
 -- any warnings in the module. See
---     http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings
+--     http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
 -- for details
 
 module WwLib ( mkWwBodies, mkWWstr, mkWorkerArgs ) where
@@ -27,9 +27,7 @@ import NewDemand      ( Demand(..), DmdResult(..), Demands(..) )
 import MkId            ( realWorldPrimId, voidArgId, mkRuntimeErrorApp, rUNTIME_ERROR_ID,
                           mkUnpackCase, mkProductBox )
 import TysWiredIn      ( tupleCon )
-import Type            ( Type, isUnLiftedType, mkFunTys,
-                         splitForAllTys, splitFunTys, isAlgType
-                       )
+import Type
 import Coercion         ( mkSymCoercion, splitNewTypeRepCo_maybe )
 import BasicTypes      ( Boxity(..) )
 import Var              ( Var, isId )
@@ -422,8 +420,9 @@ mkWWcpr :: Type                              -- function body type
                   Type)                        -- Type of worker's body 
 
 mkWWcpr body_ty RetCPR
-    | not (isAlgType body_ty)
-    = WARN( True, text "mkWWcpr: non-algebraic body type" <+> ppr body_ty )
+    | not (isClosedAlgType body_ty)
+    = WARN( True, 
+            text "mkWWcpr: non-algebraic or open body type" <+> ppr body_ty )
       returnUs (id, id, body_ty)
 
     | n_con_args == 1 && isUnLiftedType con_arg_ty1