LBangType, BangType, HsBang(..),
getBangType, getBangStrictness,
- mkExplicitHsForAllTy, mkImplicitHsForAllTy,
+ mkExplicitHsForAllTy, mkImplicitHsForAllTy, hsExplicitTvs,
hsTyVarName, hsTyVarNames, replaceTyVarName,
hsLTyVarName, hsLTyVarNames, hsLTyVarLocName, hsLTyVarLocNames,
splitHsInstDeclTy, splitHsFunType,
import {-# SOURCE #-} HsExpr ( HsSplice, pprSplice )
import Type ( Type )
-import Kind ( {- instance Outputable Kind -} Kind,
+import {- Kind parts of -}
+ Type ( {- instance Outputable Kind -} Kind,
pprParendKind, pprKind, isLiftedTypeKind )
import BasicTypes ( IPName, Boxity, tupleParens )
import SrcLoc ( Located(..), unLoc, noSrcSpan )
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
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: