X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypes%2FTyCon.lhs;h=3c1f92302cedef3f7619f187f7c8b845ea660dbe;hb=36436bc62a98f53e126ec02fe946337c4c766c3f;hp=0914b46ed0267c8f286a5b3e3649bfb82c91a25f;hpb=8761b73561019d5514194fc8b0eee2b13f0e0ec9;p=ghc-hetmet.git diff --git a/ghc/compiler/types/TyCon.lhs b/ghc/compiler/types/TyCon.lhs index 0914b46..3c1f923 100644 --- a/ghc/compiler/types/TyCon.lhs +++ b/ghc/compiler/types/TyCon.lhs @@ -36,7 +36,7 @@ module TyCon( tyConTyVars, tyConArgVrcs, algTyConRhs, tyConDataCons, tyConDataCons_maybe, tyConFamilySize, - tyConFields, tyConSelIds, + tyConSelIds, tyConStupidTheta, tyConArity, isClassTyCon, tyConClass_maybe, @@ -95,15 +95,10 @@ data TyCon tyConTyVars :: [TyVar], -- Scopes over (a) the [PredType] in AlgTyConRhs.DataTyCon -- (b) the cached types in AlgTyConRhs.NewTyCon - -- (c) the types in algTcFields -- But not over the data constructors argVrcs :: ArgVrcs, - algTcFields :: [(FieldLabel, Type, Id)], - -- Its fields (empty if none): - -- * field name - -- * its type (scoped over by tyConTyVars) - -- * record selector (name = field name) + algTcSelIds :: [Id], -- Its record selectors (empty if none): algTcStupidTheta :: [PredType], -- The "stupid theta" for the data type -- (always empty for GADTs) @@ -268,7 +263,7 @@ mkFunTyCon name kind -- This is the making of a TyCon. Just the same as the old mkAlgTyCon, -- but now you also have to pass in the generic information about the type -- constructor - you can get hold of it easily (see Generics module) -mkAlgTyCon name kind tyvars argvrcs stupid rhs flds is_rec gen_info +mkAlgTyCon name kind tyvars argvrcs stupid rhs sel_ids is_rec gen_info = AlgTyCon { tyConName = name, tyConUnique = nameUnique name, @@ -278,7 +273,7 @@ mkAlgTyCon name kind tyvars argvrcs stupid rhs flds is_rec gen_info argVrcs = argvrcs, algTcStupidTheta = stupid, algTcRhs = rhs, - algTcFields = flds, + algTcSelIds = sel_ids, algTcClass = Nothing, algTcRec = is_rec, hasGenerics = gen_info @@ -294,7 +289,7 @@ mkClassTyCon name kind tyvars argvrcs rhs clas is_rec argVrcs = argvrcs, algTcStupidTheta = [], algTcRhs = rhs, - algTcFields = [], + algTcSelIds = [], algTcClass = Just clas, algTcRec = is_rec, hasGenerics = False @@ -496,12 +491,9 @@ tyConFamilySize (TupleTyCon {}) = 1 tyConFamilySize other = pprPanic "tyConFamilySize:" (ppr other) #endif -tyConFields :: TyCon -> [(FieldLabel,Type,Id)] -tyConFields (AlgTyCon {algTcFields = fs}) = fs -tyConFields other_tycon = [] - tyConSelIds :: TyCon -> [Id] -tyConSelIds tc = [id | (_,_,id) <- tyConFields tc] +tyConSelIds (AlgTyCon {algTcSelIds = fs}) = fs +tyConSelIds other_tycon = [] algTyConRhs :: TyCon -> AlgTyConRhs algTyConRhs (AlgTyCon {algTcRhs = rhs}) = rhs