X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fprelude%2FTysWiredIn.lhs;fp=ghc%2Fcompiler%2Fprelude%2FTysWiredIn.lhs;h=88550859d192b75bdd084090f9d82fafaa020809;hb=42b63073fb5e71fcd539ab80289cf6cf2a5b9641;hp=5b6754efb75f36025c6be5904e4e368fedbfd158;hpb=87bfa396ca8cea3296e8a715766062dc4d2c1d9b;p=ghc-hetmet.git diff --git a/ghc/compiler/prelude/TysWiredIn.lhs b/ghc/compiler/prelude/TysWiredIn.lhs index 5b6754e..8855085 100644 --- a/ghc/compiler/prelude/TysWiredIn.lhs +++ b/ghc/compiler/prelude/TysWiredIn.lhs @@ -78,7 +78,7 @@ module TysWiredIn ( #include "HsVersions.h" -import {-# SOURCE #-} MkId( mkDataConId, mkDataConWrapId ) +import {-# SOURCE #-} MkId( mkDataConWorkId ) import {-# SOURCE #-} Generics( mkTyConGenInfo ) -- friends: @@ -90,7 +90,7 @@ import Constants ( mAX_TUPLE_SIZE ) import Module ( mkBasePkgModule ) import Name ( Name, nameUnique, nameOccName, nameModule, mkWiredInName ) -import OccName ( mkOccFS, tcName, dataName, mkWorkerOcc, mkGenOcc1, mkGenOcc2 ) +import OccName ( mkOccFS, tcName, dataName, mkDataConWorkerOcc, mkGenOcc1, mkGenOcc2 ) import DataCon ( DataCon, mkDataCon, dataConWorkId, dataConSourceArity ) import Var ( TyVar, tyVarKind ) import TyCon ( TyCon, AlgTyConFlavour(..), DataConDetails(..), tyConDataCons, @@ -192,27 +192,28 @@ mk_tc_gen_info mod tc_uniq tc_name tycon name2 = mkWiredInName mod occ_name2 fn2_key pcDataCon :: Name -> [TyVar] -> ThetaType -> [Type] -> TyCon -> DataCon +-- The Name should be in the DataName name space; it's the name +-- of the DataCon itself. +-- -- The unique is the first of two free uniques; --- the first is used for the datacon itself and the worker; --- the second is used for the wrapper. +-- the first is used for the datacon itself, +-- the second is used for the "worker name" -pcDataCon name tyvars context arg_tys tycon +pcDataCon dc_name tyvars context arg_tys tycon = data_con where - data_con = mkDataCon name - [ NotMarkedStrict | a <- arg_tys ] - [ {- no labelled fields -} ] - tyvars context [] [] arg_tys tycon work_id wrap_id - - wrap_occ = nameOccName name - - mod = nameModule name - wrap_id = mkDataConWrapId data_con - - work_occ = mkWorkerOcc wrap_occ - work_key = incrUnique (nameUnique name) - work_name = mkWiredInName mod work_occ work_key - work_id = mkDataConId work_name data_con + data_con = mkDataCon dc_name + [{- No strictness -}] + [{- No labelled fields -}] + tyvars context [] [] arg_tys tycon work_id + Nothing {- No wrapper for wired-in things + (they are too simple to need one) -} + + mod = nameModule dc_name + wrk_occ = mkDataConWorkerOcc (nameOccName dc_name) + wrk_key = incrUnique (nameUnique dc_name) + wrk_name = mkWiredInName mod wrk_occ wrk_key + work_id = mkDataConWorkId wrk_name data_con \end{code}