X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FhsSyn%2FHsTypes.lhs;h=2693a101d23c7c3edf7ca81344f5b95c915e94a8;hb=f297deab8887f3f6e9462e1c89598391c099bbb1;hp=68d2d90190ac6daa704c00c1f9912e0f5c6c7e5c;hpb=77ccc59a243ea419d5f04046599c3fcd2638cb21;p=ghc-hetmet.git diff --git a/compiler/hsSyn/HsTypes.lhs b/compiler/hsSyn/HsTypes.lhs index 68d2d90..2693a10 100644 --- a/compiler/hsSyn/HsTypes.lhs +++ b/compiler/hsSyn/HsTypes.lhs @@ -14,7 +14,7 @@ module HsTypes ( LBangType, BangType, HsBang(..), getBangType, getBangStrictness, - mkExplicitHsForAllTy, mkImplicitHsForAllTy, + mkExplicitHsForAllTy, mkImplicitHsForAllTy, hsExplicitTvs, hsTyVarName, hsTyVarNames, replaceTyVarName, hsLTyVarName, hsLTyVarNames, hsLTyVarLocName, hsLTyVarLocNames, splitHsInstDeclTy, splitHsFunType, @@ -190,6 +190,12 @@ mk_forall_ty exp tvs ty = HsForAllTy exp tvs (L noSrcSpan []) ty Implicit `plus` Implicit = Implicit exp1 `plus` exp2 = Explicit +hsExplicitTvs :: LHsType name -> [name] +-- The explicitly-given forall'd type variables of a HsType +hsExplicitTvs (L _ (HsForAllTy Explicit tvs _ _)) = hsLTyVarNames tvs +hsExplicitTvs other = [] + +--------------------- type LHsTyVarBndr name = Located (HsTyVarBndr name) data HsTyVarBndr name @@ -240,6 +246,7 @@ splitHsInstDeclTy inst_ty where split_tau tvs cxt (HsPredTy (HsClassP cls tys)) = (tvs, cxt, cls, tys) split_tau tvs cxt (HsParTy (L _ ty)) = split_tau tvs cxt ty + split_tau _ _ other = pprPanic "splitHsInstDeclTy" (ppr inst_ty) -- Splits HsType into the (init, last) parts -- Breaks up any parens in the result type: