ConTag, fIRST_TAG,
mkDataCon,
dataConType, dataConSig, dataConName, dataConTag,
- dataConOrigArgTys, dataConArgTys, dataConRawArgTys, dataConTyCon,
+ dataConOrigArgTys, dataConArgTys, dataConTyCon,
+ dataConRawArgTys, dataConAllRawArgTys,
dataConFieldLabels, dataConStrictMarks, dataConSourceArity,
dataConNumFields, dataConNumInstArgs, dataConId, dataConRepStrictness,
isNullaryDataCon, isTupleCon, isUnboxedTupleCon,
dataConStrictMarks :: DataCon -> [StrictnessMark]
dataConStrictMarks = dcRealStricts
-dataConRawArgTys :: DataCon -> [TauType] -- a function of convenience
-dataConRawArgTys = dcRepArgTys
-
dataConSourceArity :: DataCon -> Arity
-- Source-level arity of the data constructor
dataConSourceArity dc = length (dcOrigArgTys dc)
([mkDictTy cls tys | (cls,tys) <- ex_theta] ++ arg_tys)
\end{code}
+These two functions get the real argument types of the constructor,
+without substituting for any type variables. dataConAllRawArgTys is
+like dataConRawArgTys except that the existential dictionary arguments
+are included.
+
+\begin{code}
+dataConRawArgTys :: DataCon -> [TauType] -- a function of convenience
+dataConRawArgTys = dcRepArgTys
+
+dataConAllRawArgTys :: DataCon -> [TauType]
+dataConAllRawArgTys con =
+ [mkDictTy cls tys | (cls,tys) <- dcExTheta con] ++ dcRepArgTys con
+\end{code}
+
dataConNumFields gives the number of actual fields in the
{\em representation} of the data constructor. This may be more than appear
in the source code; the extra ones are the existentially quantified
)
import CostCentre ( dontCareCCS )
import FiniteMap ( fmToList, FiniteMap )
-import DataCon ( DataCon, dataConName, dataConRawArgTys )
+import DataCon ( DataCon, dataConName, dataConAllRawArgTys )
import Const ( Con(..) )
import Name ( getOccString )
import PrimRep ( getPrimRepSize, PrimRep(..) )
zero_arity_con = all zero_size arg_tys
- arg_tys = dataConRawArgTys data_con
+ arg_tys = dataConAllRawArgTys data_con
entry_label = mkConEntryLabel con_name
closure_label = mkStaticClosureLabel con_name
con_name = dataConName data_con
mkConCodeAndInfo con
= let
- arg_tys = dataConRawArgTys con
+ arg_tys = dataConAllRawArgTys con
(closure_info, arg_things)
= layOutDynCon con typePrimRep arg_tys