dataConRepArgTys, dataConTheta,
dataConFieldLabels, dataConStrictMarks, dataConExStricts,
dataConSourceArity, dataConRepArity,
- dataConNumInstArgs,
+ dataConNumInstArgs, dataConIsInfix,
dataConWorkId, dataConWrapId, dataConWrapId_maybe, dataConImplicitIds,
dataConRepStrictness,
isNullaryDataCon, isTupleCon, isUnboxedTupleCon,
#include "HsVersions.h"
import {-# SOURCE #-} Subst( substTyWith )
-import {-# SOURCE #-} PprType( pprType )
import Type ( Type, ThetaType,
mkForAllTys, mkFunTys, mkTyConApp,
mkTyVarTys, splitTyConApp_maybe,
- mkPredTys, isStrictPred
+ mkPredTys, isStrictPred, pprType
)
import TyCon ( TyCon, tyConDataCons, tyConDataCons, isProductTyCon,
isTupleTyCon, isUnboxedTupleTyCon )
---------------------------------------------------------------------------
* The "source data con" C DataName The DataCon itself
* The "real data con" C VarName Its worker Id
- * The "wrapper data con" $wC VarName Wrapper Id (optional)
+ * The "wrapper data con" $WC VarName Wrapper Id (optional)
Each of these three has a distinct Unique. The "source data con" name
appears in the output of the renamer, and names the Haskell-source
--
-- An entirely separate wrapper function is built in TcTyDecls
- dcIds :: DataConIds
+ dcIds :: DataConIds,
+
+ dcInfix :: Bool -- True <=> declared infix
+ -- Used for Template Haskell and 'deriving' only
+ -- The actual fixity is stored elsewhere
}
data DataConIds
\begin{code}
mkDataCon :: Name
+ -> Bool -- Declared infix
-> [StrictnessMark] -> [FieldLabel]
-> [TyVar] -> ThetaType
-> [TyVar] -> ThetaType
-> DataCon
-- Can get the tag from the TyCon
-mkDataCon name
+mkDataCon name declared_infix
arg_stricts -- Must match orig_arg_tys 1-1
fields
tyvars theta ex_tyvars ex_theta orig_arg_tys tycon
dcExTyVars = ex_tyvars, dcExTheta = ex_theta,
dcStrictMarks = arg_stricts, dcRepStrictness = rep_arg_stricts,
dcFields = fields, dcTag = tag, dcTyCon = tycon, dcRepType = ty,
- dcIds = ids}
+ dcIds = ids, dcInfix = declared_infix}
-- Strictness marks for source-args
-- *after unboxing choices*,
dataConRepType :: DataCon -> Type
dataConRepType = dcRepType
+dataConIsInfix :: DataCon -> Bool
+dataConIsInfix = dcInfix
+
dataConWorkId :: DataCon -> Id
dataConWorkId dc = case dcIds dc of
AlgDC _ wrk_id -> wrk_id