X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fprelude%2FTysWiredIn.lhs;h=18bf9a0caa835eb19e68e5787b52ba1092d9f2f6;hb=20f50b2a3651ce7dacdcb86a83afb5c5d444cb0b;hp=a2b6ae3910e600429a3fe4870b87d1778dc13a8d;hpb=495ef8bd9ef30bffe50ea399b91e3ba09646b59a;p=ghc-hetmet.git diff --git a/ghc/compiler/prelude/TysWiredIn.lhs b/ghc/compiler/prelude/TysWiredIn.lhs index a2b6ae3..18bf9a0 100644 --- a/ghc/compiler/prelude/TysWiredIn.lhs +++ b/ghc/compiler/prelude/TysWiredIn.lhs @@ -11,9 +11,17 @@ types and operations.'' \begin{code} module TysWiredIn ( + wiredInTyCons, genericTyCons, + addrDataCon, addrTy, addrTyCon, + ptrDataCon, + ptrTy, + ptrTyCon, + funPtrDataCon, + funPtrTy, + funPtrTyCon, boolTy, boolTyCon, charDataCon, @@ -22,24 +30,20 @@ module TysWiredIn ( consDataCon, doubleDataCon, doubleTy, - isDoubleTy, doubleTyCon, falseDataCon, falseDataConId, floatDataCon, floatTy, - isFloatTy, floatTyCon, intDataCon, intTy, intTyCon, - isIntTy, integerTy, integerTyCon, smallIntegerDataCon, largeIntegerDataCon, - isIntegerTy, listTyCon, @@ -53,6 +57,11 @@ module TysWiredIn ( unboxedSingletonTyCon, unboxedSingletonDataCon, unboxedPairTyCon, unboxedPairDataCon, + -- Generics + genUnitTyCon, genUnitDataCon, + plusTyCon, inrDataCon, inlDataCon, + crossTyCon, crossDataCon, + stablePtrTyCon, stringTy, trueDataCon, trueDataConId, @@ -60,19 +69,13 @@ module TysWiredIn ( voidTy, wordDataCon, wordTy, - wordTyCon, - - isFFIArgumentTy, -- :: Bool -> Type -> Bool - isFFIResultTy, -- :: Type -> Bool - isFFIExternalTy, -- :: Type -> Bool - isAddrTy, -- :: Type -> Bool - isForeignObjTy -- :: Type -> Bool - + wordTyCon ) where #include "HsVersions.h" import {-# SOURCE #-} MkId( mkDataConId, mkDataConWrapId ) +import {-# SOURCE #-} Generics( mkTyConGenInfo ) -- friends: import PrelNames @@ -80,80 +83,130 @@ import TysPrim -- others: import Constants ( mAX_TUPLE_SIZE ) -import Module ( Module, mkPrelModule ) -import Name ( mkWiredInTyConName, mkWiredInIdName, mkSrcOccFS, mkWorkerOcc, dataName ) -import DataCon ( DataCon, StrictnessMark(..), mkDataCon, dataConId ) +import Module ( mkPrelModule ) +import Name ( Name, nameRdrName, nameUnique, nameOccName, + nameModule, mkWiredInName ) +import OccName ( mkOccFS, tcName, dataName, mkWorkerOcc, mkGenOcc1, mkGenOcc2 ) +import RdrName ( rdrNameOcc ) +import DataCon ( DataCon, mkDataCon, dataConId ) import Var ( TyVar, tyVarKind ) -import TyCon ( TyCon, AlgTyConFlavour(..), ArgVrcs, tyConDataCons, - mkAlgTyCon, mkSynTyCon, mkTupleTyCon, isUnLiftedTyCon +import TyCon ( TyCon, AlgTyConFlavour(..), tyConDataCons, + mkTupleTyCon, mkAlgTyCon ) -import BasicTypes ( Arity, NewOrData(..), RecFlag(..), Boxity(..), isBoxed ) -import Type ( Type, mkTyConTy, mkTyConApp, mkSigmaTy, mkTyVarTys, - mkArrowKinds, boxedTypeKind, unboxedTypeKind, - mkFunTy, mkFunTys, - splitTyConApp_maybe, repType, - TauType, ClassContext ) -import PrimRep ( PrimRep(..) ) -import Unique -import CmdLineOpts ( opt_GlasgowExts ) -import Util ( assoc ) -import Panic ( panic ) + +import BasicTypes ( Arity, RecFlag(..), Boxity(..), isBoxed, StrictnessMark(..) ) + +import Type ( Type, mkTyConTy, mkTyConApp, mkTyVarTys, + mkArrowKinds, liftedTypeKind, unliftedTypeKind, + ThetaType ) +import Unique ( incrUnique, mkTupleTyConUnique, mkTupleDataConUnique ) +import PrelNames import Array alpha_tyvar = [alphaTyVar] alpha_ty = [alphaTy] alpha_beta_tyvars = [alphaTyVar, betaTyVar] +\end{code} -pcRecDataTyCon, pcNonRecDataTyCon - :: Unique{-TyConKey-} -> Module -> FAST_STRING - -> [TyVar] -> ArgVrcs -> [DataCon] -> TyCon -pcRecDataTyCon = pcTyCon DataTyCon Recursive +%************************************************************************ +%* * +\subsection{Wired in type constructors} +%* * +%************************************************************************ + +\begin{code} +wiredInTyCons :: [TyCon] +wiredInTyCons = data_tycons ++ tuple_tycons ++ unboxed_tuple_tycons + +data_tycons = genericTyCons ++ + [ addrTyCon + , ptrTyCon + , funPtrTyCon + , boolTyCon + , charTyCon + , doubleTyCon + , floatTyCon + , intTyCon + , integerTyCon + , listTyCon + , wordTyCon + ] + +genericTyCons :: [TyCon] +genericTyCons = [ plusTyCon, crossTyCon, genUnitTyCon ] + + +tuple_tycons = unitTyCon : [tupleTyCon Boxed i | i <- [2..mAX_TUPLE_SIZE] ] +unboxed_tuple_tycons = [tupleTyCon Unboxed i | i <- [1..mAX_TUPLE_SIZE] ] +\end{code} + + +%************************************************************************ +%* * +\subsection{mkWiredInTyCon} +%* * +%************************************************************************ + +\begin{code} pcNonRecDataTyCon = pcTyCon DataTyCon NonRecursive +pcRecDataTyCon = pcTyCon DataTyCon Recursive -pcTyCon new_or_data is_rec key mod str tyvars argvrcs cons +pcTyCon new_or_data is_rec name tyvars argvrcs cons = tycon where - tycon = mkAlgTyCon name kind - tyvars - [] -- No context + tycon = mkAlgTyCon name kind + tyvars + [] -- No context argvrcs - cons - (length cons) - [] -- No derivings - new_or_data - is_rec - - name = mkWiredInTyConName key mod str tycon - kind = mkArrowKinds (map tyVarKind tyvars) boxedTypeKind - -pcSynTyCon key mod str kind arity tyvars expansion argvrcs -- this fun never used! - = tycon + cons + (length cons) + [] -- No record selectors + new_or_data + is_rec + gen_info + + mod = nameModule name + kind = mkArrowKinds (map tyVarKind tyvars) liftedTypeKind + gen_info = mk_tc_gen_info mod (nameUnique name) name tycon + +-- We generate names for the generic to/from Ids by incrementing +-- the TyCon unique. So each Prelude tycon needs 3 slots, one +-- for itself and two more for the generic Ids. +mk_tc_gen_info mod tc_uniq tc_name tycon + = mkTyConGenInfo tycon [name1, name2] where - tycon = mkSynTyCon name kind arity tyvars expansion argvrcs - name = mkWiredInTyConName key mod str tycon - -pcDataCon :: Unique{-DataConKey-} -> Module -> FAST_STRING - -> [TyVar] -> ClassContext -> [TauType] -> TyCon -> DataCon + tc_occ_name = nameOccName tc_name + occ_name1 = mkGenOcc1 tc_occ_name + occ_name2 = mkGenOcc2 tc_occ_name + fn1_key = incrUnique tc_uniq + fn2_key = incrUnique fn1_key + name1 = mkWiredInName mod occ_name1 fn1_key + name2 = mkWiredInName mod occ_name2 fn2_key + +pcDataCon :: Name -> [TyVar] -> ThetaType -> [Type] -> TyCon -> DataCon -- The unique is the first of two free uniques; --- the first is used for the datacon itself and the worker; +-- the first is used for the datacon itself and the worker; -- the second is used for the wrapper. -pcDataCon wrap_key mod str tyvars context arg_tys tycon + +pcDataCon name tyvars context arg_tys tycon = data_con where - data_con = mkDataCon wrap_name - [ NotMarkedStrict | a <- arg_tys ] - [ {- no labelled fields -} ] - tyvars context [] [] arg_tys tycon work_id wrap_id + data_con = mkDataCon name + [ NotMarkedStrict | a <- arg_tys ] + [ {- no labelled fields -} ] + tyvars context [] [] arg_tys tycon work_id wrap_id + + wrap_rdr = nameRdrName name + wrap_occ = rdrNameOcc wrap_rdr + + mod = nameModule name + wrap_id = mkDataConWrapId data_con work_occ = mkWorkerOcc wrap_occ - work_key = incrUnique wrap_key - work_name = mkWiredInIdName work_key mod work_occ work_id + work_key = incrUnique (nameUnique name) + work_name = mkWiredInName mod work_occ work_key work_id = mkDataConId work_name data_con - - wrap_occ = mkSrcOccFS dataName str - wrap_name = mkWiredInIdName wrap_key mod wrap_occ wrap_id - wrap_id = mkDataConWrapId data_con \end{code} @@ -181,21 +234,23 @@ unboxedTupleArr = array (0,mAX_TUPLE_SIZE) [(i,mk_tuple Unboxed i) | i <- [0..mA mk_tuple :: Boxity -> Int -> (TyCon,DataCon) mk_tuple boxity arity = (tycon, tuple_con) where - tycon = mkTupleTyCon tc_name tc_kind arity tyvars tuple_con boxity - tc_name = mkWiredInTyConName tc_uniq mod name_str tycon + tycon = mkTupleTyCon tc_name tc_kind arity tyvars tuple_con boxity gen_info + tc_name = mkWiredInName mod (mkOccFS tcName name_str) tc_uniq tc_kind = mkArrowKinds (map tyVarKind tyvars) res_kind - res_kind | isBoxed boxity = boxedTypeKind - | otherwise = unboxedTypeKind + res_kind | isBoxed boxity = liftedTypeKind + | otherwise = unliftedTypeKind tyvars | isBoxed boxity = take arity alphaTyVars | otherwise = take arity openAlphaTyVars - tuple_con = pcDataCon dc_uniq mod name_str tyvars [] tyvar_tys tycon + tuple_con = pcDataCon name tyvars [] tyvar_tys tycon tyvar_tys = mkTyVarTys tyvars (mod_name, name_str) = mkTupNameStr boxity arity + name = mkWiredInName mod (mkOccFS dataName name_str) dc_uniq tc_uniq = mkTupleTyConUnique boxity arity dc_uniq = mkTupleDataConUnique boxity arity mod = mkPrelModule mod_name + gen_info = mk_tc_gen_info mod tc_uniq tc_name tycon unitTyCon = tupleTyCon Boxed 0 unitDataConId = dataConId (head (tyConDataCons unitTyCon)) @@ -222,7 +277,7 @@ unboxedPairDataCon = tupleCon Unboxed 2 -- -- data Void = -- No constructors! -- --- ) It's boxed; there is only one value of this +-- ) It's lifted; there is only one value of this -- type, namely "void", whose semantics is just bottom. -- -- Haskell 98 drops the definition of a Void type, so we just 'simulate' @@ -234,8 +289,8 @@ voidTy = unitTy \begin{code} charTy = mkTyConTy charTyCon -charTyCon = pcNonRecDataTyCon charTyConKey pREL_BASE SLIT("Char") [] [] [charDataCon] -charDataCon = pcDataCon charDataConKey pREL_BASE SLIT("C#") [] [] [charPrimTy] charTyCon +charTyCon = pcNonRecDataTyCon charTyConName [] [] [charDataCon] +charDataCon = pcDataCon charDataConName [] [] [charPrimTy] charTyCon stringTy = mkListTy charTy -- convenience only \end{code} @@ -243,72 +298,80 @@ stringTy = mkListTy charTy -- convenience only \begin{code} intTy = mkTyConTy intTyCon -intTyCon = pcNonRecDataTyCon intTyConKey pREL_BASE SLIT("Int") [] [] [intDataCon] -intDataCon = pcDataCon intDataConKey pREL_BASE SLIT("I#") [] [] [intPrimTy] intTyCon - -isIntTy :: Type -> Bool -isIntTy = isTyCon intTyConKey +intTyCon = pcNonRecDataTyCon intTyConName [] [] [intDataCon] +intDataCon = pcDataCon intDataConName [] [] [intPrimTy] intTyCon \end{code} \begin{code} - wordTy = mkTyConTy wordTyCon -wordTyCon = pcNonRecDataTyCon wordTyConKey pREL_ADDR SLIT("Word") [] [] [wordDataCon] -wordDataCon = pcDataCon wordDataConKey pREL_ADDR SLIT("W#") [] [] [wordPrimTy] wordTyCon +wordTyCon = pcNonRecDataTyCon wordTyConName [] [] [wordDataCon] +wordDataCon = pcDataCon wordDataConName [] [] [wordPrimTy] wordTyCon \end{code} \begin{code} addrTy = mkTyConTy addrTyCon -addrTyCon = pcNonRecDataTyCon addrTyConKey pREL_ADDR SLIT("Addr") [] [] [addrDataCon] -addrDataCon = pcDataCon addrDataConKey pREL_ADDR SLIT("A#") [] [] [addrPrimTy] addrTyCon +addrTyCon = pcNonRecDataTyCon addrTyConName [] [] [addrDataCon] +addrDataCon = pcDataCon addrDataConName [] [] [addrPrimTy] addrTyCon +\end{code} -isAddrTy :: Type -> Bool -isAddrTy = isTyCon addrTyConKey +\begin{code} +ptrTy = mkTyConTy ptrTyCon + +ptrTyCon = pcNonRecDataTyCon ptrTyConName alpha_tyvar [(True,False)] [ptrDataCon] +ptrDataCon = pcDataCon ptrDataConName alpha_tyvar [] [addrPrimTy] ptrTyCon \end{code} \begin{code} -floatTy = mkTyConTy floatTyCon +funPtrTy = mkTyConTy funPtrTyCon + +funPtrTyCon = pcNonRecDataTyCon funPtrTyConName alpha_tyvar [(True,False)] [funPtrDataCon] +funPtrDataCon = pcDataCon funPtrDataConName alpha_tyvar [] [addrPrimTy] funPtrTyCon +\end{code} -floatTyCon = pcNonRecDataTyCon floatTyConKey pREL_FLOAT SLIT("Float") [] [] [floatDataCon] -floatDataCon = pcDataCon floatDataConKey pREL_FLOAT SLIT("F#") [] [] [floatPrimTy] floatTyCon +\begin{code} +floatTy = mkTyConTy floatTyCon -isFloatTy :: Type -> Bool -isFloatTy = isTyCon floatTyConKey +floatTyCon = pcNonRecDataTyCon floatTyConName [] [] [floatDataCon] +floatDataCon = pcDataCon floatDataConName [] [] [floatPrimTy] floatTyCon \end{code} \begin{code} doubleTy = mkTyConTy doubleTyCon -isDoubleTy :: Type -> Bool -isDoubleTy = isTyCon doubleTyConKey - -doubleTyCon = pcNonRecDataTyCon doubleTyConKey pREL_FLOAT SLIT("Double") [] [] [doubleDataCon] -doubleDataCon = pcDataCon doubleDataConKey pREL_FLOAT SLIT("D#") [] [] [doublePrimTy] doubleTyCon +doubleTyCon = pcNonRecDataTyCon doubleTyConName [] [] [doubleDataCon] +doubleDataCon = pcDataCon doubleDataConName [] [] [doublePrimTy] doubleTyCon \end{code} \begin{code} stablePtrTyCon - = pcNonRecDataTyCon stablePtrTyConKey pREL_STABLE SLIT("StablePtr") + = pcNonRecDataTyCon stablePtrTyConName alpha_tyvar [(True,False)] [stablePtrDataCon] where stablePtrDataCon - = pcDataCon stablePtrDataConKey pREL_STABLE SLIT("StablePtr") + = pcDataCon stablePtrDataConName alpha_tyvar [] [mkStablePtrPrimTy alphaTy] stablePtrTyCon \end{code} \begin{code} foreignObjTyCon - = pcNonRecDataTyCon foreignObjTyConKey pREL_IO_BASE SLIT("ForeignObj") + = pcNonRecDataTyCon foreignObjTyConName [] [] [foreignObjDataCon] where foreignObjDataCon - = pcDataCon foreignObjDataConKey pREL_IO_BASE SLIT("ForeignObj") + = pcDataCon foreignObjDataConName [] [] [foreignObjPrimTy] foreignObjTyCon +\end{code} -isForeignObjTy :: Type -> Bool -isForeignObjTy = isTyCon foreignObjTyConKey +\begin{code} +foreignPtrTyCon + = pcNonRecDataTyCon foreignPtrTyConName + alpha_tyvar [(True,False)] [foreignPtrDataCon] + where + foreignPtrDataCon + = pcDataCon foreignPtrDataConName + alpha_tyvar [] [foreignObjPrimTy] foreignPtrTyCon \end{code} %************************************************************************ @@ -322,90 +385,13 @@ isForeignObjTy = isTyCon foreignObjTyConKey integerTy :: Type integerTy = mkTyConTy integerTyCon -integerTyCon = pcNonRecDataTyCon integerTyConKey pREL_NUM SLIT("Integer") +integerTyCon = pcNonRecDataTyCon integerTyConName [] [] [smallIntegerDataCon, largeIntegerDataCon] -smallIntegerDataCon = pcDataCon smallIntegerDataConKey pREL_NUM SLIT("S#") +smallIntegerDataCon = pcDataCon smallIntegerDataConName [] [] [intPrimTy] integerTyCon -largeIntegerDataCon = pcDataCon largeIntegerDataConKey pREL_NUM SLIT("J#") +largeIntegerDataCon = pcDataCon largeIntegerDataConName [] [] [intPrimTy, byteArrayPrimTy] integerTyCon - - -isIntegerTy :: Type -> Bool -isIntegerTy = isTyCon integerTyConKey -\end{code} - - -%************************************************************************ -%* * -\subsection[TysWiredIn-ext-type]{External types} -%* * -%************************************************************************ - -The compiler's foreign function interface supports the passing of a -restricted set of types as arguments and results (the restricting factor -being the ) - -\begin{code} -isFFIArgumentTy :: Bool -> Type -> Bool --- Checks for valid argument type for a 'foreign import' -isFFIArgumentTy is_safe ty = checkTyCon (legalOutgoingTyCon is_safe) ty - -isFFIExternalTy :: Type -> Bool --- Types that are allowed as arguments of a 'foreign export' -isFFIExternalTy ty = checkTyCon legalIncomingTyCon ty - -isFFIResultTy :: Type -> Bool --- Types that are allowed as a result of a 'foreign import' or of a 'foreign export' --- Maybe we should distinguish between import and export, but --- here we just choose the more restrictive 'incoming' predicate --- But we allow () as well -isFFIResultTy ty = checkTyCon (\tc -> tc == unitTyCon || legalIncomingTyCon tc) ty - -checkTyCon :: (TyCon -> Bool) -> Type -> Bool -checkTyCon check_tc ty = case splitTyConApp_maybe (repType ty) of - Just (tycon, _) -> check_tc tycon - Nothing -> False - -isTyCon :: Unique -> Type -> Bool -isTyCon uniq ty = checkTyCon (\tc -> uniq == getUnique tc) ty -\end{code} - ----------------------------------------------- -These chaps do the work; they are not exported ----------------------------------------------- - -\begin{code} -legalIncomingTyCon :: TyCon -> Bool --- It's illegal to return foreign objects and (mutable) --- bytearrays from a _ccall_ / foreign declaration --- (or be passed them as arguments in foreign exported functions). -legalIncomingTyCon tc - | getUnique tc `elem` [ foreignObjTyConKey, byteArrayTyConKey, mutableByteArrayTyConKey ] - = False - | otherwise - = marshalableTyCon tc - -legalOutgoingTyCon :: Bool -> TyCon -> Bool --- Checks validity of types going from Haskell -> external world --- The boolean is true for a 'safe' call (when we don't want to --- pass Haskell pointers to the world) -legalOutgoingTyCon be_safe tc - | be_safe && getUnique tc `elem` [byteArrayTyConKey, mutableByteArrayTyConKey] - = False - | otherwise - = marshalableTyCon tc - -marshalableTyCon tc - = (opt_GlasgowExts && isUnLiftedTyCon tc) - || getUnique tc `elem` [ intTyConKey, int8TyConKey, int16TyConKey, int32TyConKey, int64TyConKey - , wordTyConKey, word8TyConKey, word16TyConKey, word32TyConKey, word64TyConKey - , floatTyConKey, doubleTyConKey - , addrTyConKey, charTyConKey, foreignObjTyConKey - , stablePtrTyConKey - , byteArrayTyConKey, mutableByteArrayTyConKey - , boolTyConKey - ] \end{code} @@ -460,11 +446,11 @@ primitive counterpart. \begin{code} boolTy = mkTyConTy boolTyCon -boolTyCon = pcTyCon EnumTyCon NonRecursive boolTyConKey - pREL_BASE SLIT("Bool") [] [] [falseDataCon, trueDataCon] +boolTyCon = pcTyCon EnumTyCon NonRecursive boolTyConName + [] [] [falseDataCon, trueDataCon] -falseDataCon = pcDataCon falseDataConKey pREL_BASE SLIT("False") [] [] [] boolTyCon -trueDataCon = pcDataCon trueDataConKey pREL_BASE SLIT("True") [] [] [] boolTyCon +falseDataCon = pcDataCon falseDataConName [] [] [] boolTyCon +trueDataCon = pcDataCon trueDataConName [] [] [] boolTyCon falseDataConId = dataConId falseDataCon trueDataConId = dataConId trueDataCon @@ -489,14 +475,12 @@ data (,) a b = (,,) a b mkListTy :: Type -> Type mkListTy ty = mkTyConApp listTyCon [ty] -alphaListTy = mkSigmaTy alpha_tyvar [] (mkTyConApp listTyCon alpha_ty) - -listTyCon = pcRecDataTyCon listTyConKey pREL_BASE SLIT("[]") +listTyCon = pcRecDataTyCon listTyConName alpha_tyvar [(True,False)] [nilDataCon, consDataCon] -nilDataCon = pcDataCon nilDataConKey pREL_BASE SLIT("[]") alpha_tyvar [] [] listTyCon -consDataCon = pcDataCon consDataConKey pREL_BASE SLIT(":") - alpha_tyvar [] [alphaTy, mkTyConApp listTyCon alpha_ty] listTyCon +nilDataCon = pcDataCon nilDataConName alpha_tyvar [] [] listTyCon +consDataCon = pcDataCon consDataConName + alpha_tyvar [] [alphaTy, mkTyConApp listTyCon alpha_ty] listTyCon -- Interesting: polymorphic recursion would help here. -- We can't use (mkListTy alphaTy) in the defn of consDataCon, else mkListTy -- gets the over-specific type (Type -> Type) @@ -554,3 +538,38 @@ mkTupleTy boxity arity tys = mkTyConApp (tupleTyCon boxity arity) tys unitTy = mkTupleTy Boxed 0 [] \end{code} + +%************************************************************************ +%* * +\subsection{Wired In Type Constructors for Representation Types} +%* * +%************************************************************************ + +The following code defines the wired in datatypes cross, plus, unit +and c_of needed for the generic methods. + +Ok, so the basic story is that for each type constructor I need to +create 2 things - a TyCon and a DataCon and then we are basically +ok. There are going to be no arguments passed to these functions +because -well- there is nothing to pass to these functions. + +\begin{code} +crossTyCon :: TyCon +crossTyCon = pcNonRecDataTyCon crossTyConName alpha_beta_tyvars [] [crossDataCon] + +crossDataCon :: DataCon +crossDataCon = pcDataCon crossDataConName alpha_beta_tyvars [] [alphaTy, betaTy] crossTyCon + +plusTyCon :: TyCon +plusTyCon = pcNonRecDataTyCon plusTyConName alpha_beta_tyvars [] [inlDataCon, inrDataCon] + +inlDataCon, inrDataCon :: DataCon +inlDataCon = pcDataCon inlDataConName alpha_beta_tyvars [] [alphaTy] plusTyCon +inrDataCon = pcDataCon inrDataConName alpha_beta_tyvars [] [betaTy] plusTyCon + +genUnitTyCon :: TyCon -- The "1" type constructor for generics +genUnitTyCon = pcNonRecDataTyCon genUnitTyConName [] [] [genUnitDataCon] + +genUnitDataCon :: DataCon +genUnitDataCon = pcDataCon genUnitDataConName [] [] [] genUnitTyCon +\end{code}