-mkDataConTag con = mkIntLitInt (dataConTag con - fIRST_TAG)
-
-splitUnTy :: String -> Name -> Type -> Type
-splitUnTy s name ty
- | Just (tc, [ty']) <- splitTyConApp_maybe ty
- , tyConName tc == name
- = ty'
-
- | otherwise = pprPanic s (ppr ty)
-
-splitBinTy :: String -> Name -> Type -> (Type, Type)
-splitBinTy s name ty
- | Just (tc, [ty1, ty2]) <- splitTyConApp_maybe ty
- , tyConName tc == name
- = (ty1, ty2)
-
- | otherwise = pprPanic s (ppr ty)
-
-splitFixedTyConApp :: TyCon -> Type -> [Type]
-splitFixedTyConApp tc ty
- | Just (tc', tys) <- splitTyConApp_maybe ty
- , tc == tc'
- = tys
-
- | otherwise = pprPanic "splitFixedTyConApp" (ppr tc <+> ppr ty)
-
-splitClosureTy :: Type -> (Type, Type)
-splitClosureTy = splitBinTy "splitClosureTy" closureTyConName
-
-splitPArrayTy :: Type -> Type
-splitPArrayTy = splitUnTy "splitPArrayTy" parrayTyConName