X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FbasicTypes%2FDataCon.lhs;h=851bf661da52d639a68ea60a66e7ed5d89aedf6b;hb=5862b2c52a1d678ef54ddbbdbcec93999bc247cc;hp=2c4400b3b60d748b11037cbcd3d1765f91689a37;hpb=5822cb8d13aa3c05d2b46b4510c13d94b902eb21;p=ghc-hetmet.git diff --git a/compiler/basicTypes/DataCon.lhs b/compiler/basicTypes/DataCon.lhs index 2c4400b..851bf66 100644 --- a/compiler/basicTypes/DataCon.lhs +++ b/compiler/basicTypes/DataCon.lhs @@ -44,7 +44,6 @@ import ListSetOps import Util import Maybes import FastString -import PackageConfig import Module import Data.Char @@ -525,6 +524,7 @@ mkDataCon name declared_infix eqSpecPreds :: [(TyVar,Type)] -> ThetaType eqSpecPreds spec = [ mkEqPred (mkTyVarTy tv, ty) | (tv,ty) <- spec ] +mk_dict_strict_mark :: PredType -> StrictnessMark mk_dict_strict_mark pred | isStrictPred pred = MarkedStrict | otherwise = NotMarkedStrict \end{code} @@ -608,6 +608,7 @@ dataConSourceArity dc = length (dcOrigArgTys dc) -- {\em representation} of the data constructor. This may be more than appear -- in the source code; the extra ones are the existentially quantified -- dictionaries +dataConRepArity :: DataCon -> Int dataConRepArity (MkData {dcRepArgTys = arg_tys}) = length arg_tys isNullarySrcDataCon, isNullaryRepDataCon :: DataCon -> Bool @@ -784,14 +785,16 @@ splitProductType_maybe ty where data_con = ASSERT( not (null (tyConDataCons tycon)) ) head (tyConDataCons tycon) - other -> Nothing + _other -> Nothing +splitProductType :: String -> Type -> (TyCon, [Type], DataCon, [Type]) splitProductType str ty = case splitProductType_maybe ty of Just stuff -> stuff Nothing -> pprPanic (str ++ ": not a product") (pprType ty) +deepSplitProductType_maybe :: Type -> Maybe (TyCon, [Type], DataCon, [Type]) deepSplitProductType_maybe ty = do { (res@(tycon, tycon_args, _, _)) <- splitProductType_maybe ty ; let {result @@ -804,6 +807,7 @@ deepSplitProductType_maybe ty ; result } +deepSplitProductType :: String -> Type -> (TyCon, [Type], DataCon, [Type]) deepSplitProductType str ty = case deepSplitProductType_maybe ty of Just stuff -> stuff