X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Fiface%2FIfaceSyn.lhs;h=330a6fc605812fa22134ae08b519222d0b743fe8;hb=35bdec7ae3bc2d0d2d2821bd9145d3b53f0e44e8;hp=0801f10e1241c696ba0fc5bbae2d5544c11cf505;hpb=30080d13aa518e200709906c90a3f0d28cf1c123;p=ghc-hetmet.git diff --git a/compiler/iface/IfaceSyn.lhs b/compiler/iface/IfaceSyn.lhs index 0801f10..330a6fc 100644 --- a/compiler/iface/IfaceSyn.lhs +++ b/compiler/iface/IfaceSyn.lhs @@ -38,7 +38,6 @@ import IfaceType import NewDemand ( StrictSig, pprIfaceStrictSig ) import TcType ( deNoteType ) import Class ( FunDep, DefMeth, pprFundeps ) -import TyCon ( ArgVrcs ) import OccName ( OccName, parenSymOcc, occNameFS, OccSet, unionOccSets, unitOccSet ) import UniqFM ( UniqFM, emptyUFM, addToUFM, lookupUFM ) @@ -76,7 +75,6 @@ data IfaceDecl ifCtxt :: IfaceContext, -- The "stupid theta" ifCons :: IfaceConDecls, -- Includes new/data info ifRec :: RecFlag, -- Recursive or not? - ifVrcs :: ArgVrcs, ifGadtSyntax :: Bool, -- True <=> declared using GADT syntax ifGeneric :: Bool -- True <=> generic converter functions available } -- We need this for imported data decls, since the @@ -85,7 +83,6 @@ data IfaceDecl | IfaceSyn { ifName :: OccName, -- Type constructor ifTyVars :: [IfaceTvBndr], -- Type variables - ifVrcs :: ArgVrcs, ifSynRhs :: IfaceType -- synonym expansion } @@ -94,8 +91,7 @@ data IfaceDecl ifTyVars :: [IfaceTvBndr], -- Type variables ifFDs :: [FunDep FastString], -- Functional dependencies ifSigs :: [IfaceClassOp], -- Method signatures - ifRec :: RecFlag, -- Is newtype/datatype associated with the class recursive? - ifVrcs :: ArgVrcs -- ... and what are its argument variances ... + ifRec :: RecFlag -- Is newtype/datatype associated with the class recursive? } | IfaceForeign { ifName :: OccName, -- Needs expanding when we move beyond .NET @@ -199,7 +195,7 @@ data IfaceNote = IfaceSCC CostCentre | IfaceCoreNote String type IfaceAlt = (IfaceConAlt, [FastString], IfaceExpr) - -- Note: OccName, not IfaceBndr (and same with the case binder) + -- Note: FastString, not IfaceBndr (and same with the case binder) -- We reconstruct the kind/type of the thing from the context -- thus saving bulk in interface files @@ -233,16 +229,15 @@ pprIfaceDecl (IfaceId {ifName = var, ifType = ty, ifIdInfo = info}) pprIfaceDecl (IfaceForeign {ifName = tycon}) = hsep [ptext SLIT("foreign import type dotnet"), ppr tycon] -pprIfaceDecl (IfaceSyn {ifName = tycon, ifTyVars = tyvars, ifSynRhs = mono_ty, ifVrcs = vrcs}) +pprIfaceDecl (IfaceSyn {ifName = tycon, ifTyVars = tyvars, ifSynRhs = mono_ty}) = hang (ptext SLIT("type") <+> pprIfaceDeclHead [] tycon tyvars) - 4 (vcat [equals <+> ppr mono_ty, - pprVrcs vrcs]) + 4 (equals <+> ppr mono_ty) pprIfaceDecl (IfaceData {ifName = tycon, ifGeneric = gen, ifCtxt = context, ifTyVars = tyvars, ifCons = condecls, - ifRec = isrec, ifVrcs = vrcs}) + ifRec = isrec}) = hang (pp_nd <+> pprIfaceDeclHead context tycon tyvars) - 4 (vcat [pprVrcs vrcs, pprRec isrec, pprGen gen, pp_condecls tycon condecls]) + 4 (vcat [pprRec isrec, pprGen gen, pp_condecls tycon condecls]) where pp_nd = case condecls of IfAbstractTyCon -> ptext SLIT("data") @@ -250,13 +245,11 @@ pprIfaceDecl (IfaceData {ifName = tycon, ifGeneric = gen, ifCtxt = context, IfNewTyCon _ -> ptext SLIT("newtype") pprIfaceDecl (IfaceClass {ifCtxt = context, ifName = clas, ifTyVars = tyvars, - ifFDs = fds, ifSigs = sigs, ifVrcs = vrcs, ifRec = isrec}) + ifFDs = fds, ifSigs = sigs, ifRec = isrec}) = hang (ptext SLIT("class") <+> pprIfaceDeclHead context clas tyvars <+> pprFundeps fds) - 4 (vcat [pprVrcs vrcs, - pprRec isrec, + 4 (vcat [pprRec isrec, sep (map ppr sigs)]) -pprVrcs vrcs = ptext SLIT("Variances") <+> ppr vrcs pprRec isrec = ptext SLIT("RecFlag") <+> ppr isrec pprGen True = ptext SLIT("Generics: yes") pprGen False = ptext SLIT("Generics: no") @@ -288,7 +281,8 @@ pprIfaceConDecl tc main_payload = ppr name <+> dcolon <+> pprIfaceForAllPart (univ_tvs ++ ex_tvs) (eq_ctxt ++ ctxt) (ppr con_tau) - eq_ctxt = [(IfaceEqPred (IfaceTyVar tv) ty) | (tv,ty) <- eq_spec] + eq_ctxt = [(IfaceEqPred (IfaceTyVar (occNameFS tv)) ty) + | (tv,ty) <- eq_spec] con_tau = foldr1 IfaceFunTy (arg_tys ++ [tc_app]) tc_app = IfaceTyConApp (IfaceTc (LocalTop tc)) [IfaceTyVar tv | (tv,_) <- univ_tvs] @@ -513,7 +507,6 @@ eqIfDecl d1@(IfaceForeign {}) d2@(IfaceForeign {}) eqIfDecl d1@(IfaceData {}) d2@(IfaceData {}) = bool (ifName d1 == ifName d2 && ifRec d1 == ifRec d2 && - ifVrcs d1 == ifVrcs d2 && ifGadtSyntax d1 == ifGadtSyntax d2 && ifGeneric d1 == ifGeneric d2) &&& eqWith (ifTyVars d1) (ifTyVars d2) (\ env -> @@ -532,8 +525,7 @@ eqIfDecl d1@(IfaceSyn {}) d2@(IfaceSyn {}) eqIfDecl d1@(IfaceClass {}) d2@(IfaceClass {}) = bool (ifName d1 == ifName d2 && - ifRec d1 == ifRec d2 && - ifVrcs d1 == ifVrcs d2) &&& + ifRec d1 == ifRec d2) &&& eqWith (ifTyVars d1) (ifTyVars d2) (\ env -> eq_ifContext env (ifCtxt d1) (ifCtxt d2) &&& eqListBy (eq_hsFD env) (ifFDs d1) (ifFDs d2) &&&