mkSynTy, isSynTy,
mkForAllTy, mkForAllTys, splitForAllTy_maybe, splitForAllTys,
- applyTy, applyTys,
+ applyTy, applyTys, isForAllTy,
TauType, RhoType, SigmaType, ThetaType,
isTauTy,
splitForAllTy_maybe (ForAllTy tyvar ty) = Just(tyvar, ty)
splitForAllTy_maybe _ = Nothing
+isForAllTy :: GenType flexi -> Bool
+isForAllTy (SynTy _ ty) = isForAllTy ty
+isForAllTy (ForAllTy tyvar ty) = True
+isForAllTy _ = False
+
splitForAllTys :: GenType flexi -> ([GenTyVar flexi], GenType flexi)
splitForAllTys ty = split ty ty []
where
match _ _ _ = \s -> Nothing
match_list [] tys2 k = \s -> k (s, tys2)
-match_list (ty1:tys1) [] k = panic "match_list"
+match_list (ty1:tys1) [] k = \s -> Nothing -- Not enough arg tys => failure
match_list (ty1:tys1) (ty2:tys2) k = match ty1 ty2 (match_list tys1 tys2 k)
\end{code}