[project @ 2005-11-23 12:27:43 by simonmar]
[ghc-hetmet.git] / ghc / compiler / coreSyn / CoreUtils.lhs
index 8aba9b1..e358be4 100644 (file)
@@ -52,7 +52,7 @@ import Packages               ( isDllName )
 #endif
 import Literal         ( hashLiteral, literalType, litIsDupable, 
                          litIsTrivial, isZeroLit, Literal( MachLabel ) )
-import DataCon         ( DataCon, dataConRepArity, dataConArgTys,
+import DataCon         ( DataCon, dataConRepArity, dataConInstArgTys,
                          isVanillaDataCon, dataConTyCon )
 import PrimOp          ( PrimOp(..), primOpOkForSpeculation, primOpIsCheap )
 import Id              ( Id, idType, globalIdDetails, idNewStrictness, 
@@ -455,7 +455,7 @@ idAppIsCheap id n_val_args
   | otherwise 
   = case globalIdDetails id of
        DataConWorkId _ -> True
-       RecordSelId _ _ -> n_val_args == 1      -- I'm experimenting with making record selection
+       RecordSelId {}  -> n_val_args == 1      -- I'm experimenting with making record selection
        ClassOpId _     -> n_val_args == 1      -- look cheap, so we will substitute it inside a
                                                -- lambda.  Particularly for dictionary field selection.
                -- BUT: Take care with (sel d x)!  The (sel d) might be cheap, but
@@ -651,7 +651,7 @@ exprIsConApp_maybe (Note (Coerce to_ty from_ty) expr)
     let
        arity            = tyConArity tc
        val_args         = drop arity args
-       to_arg_tys       = dataConArgTys dc tc_arg_tys
+       to_arg_tys       = dataConInstArgTys dc tc_arg_tys
        mk_coerce ty arg = mkCoerce ty arg
        new_val_args     = zipWith mk_coerce to_arg_tys val_args
     in