X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FbasicTypes%2FDataCon.lhs;h=851bf661da52d639a68ea60a66e7ed5d89aedf6b;hb=5862b2c52a1d678ef54ddbbdbcec93999bc247cc;hp=5daf74e692b1bbd06406479b80237e24e601c49e;hpb=ad94d40948668032189ad22a0ad741ac1f645f50;p=ghc-hetmet.git diff --git a/compiler/basicTypes/DataCon.lhs b/compiler/basicTypes/DataCon.lhs index 5daf74e..851bf66 100644 --- a/compiler/basicTypes/DataCon.lhs +++ b/compiler/basicTypes/DataCon.lhs @@ -5,13 +5,6 @@ \section[DataCon]{@DataCon@: Data Constructors} \begin{code} -{-# 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/CodingStyle#Warnings --- for details - module DataCon ( DataCon, DataConIds(..), ConTag, fIRST_TAG, @@ -51,7 +44,6 @@ import ListSetOps import Util import Maybes import FastString -import PackageConfig import Module import Data.Char @@ -532,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} @@ -615,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 @@ -791,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 @@ -811,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