[project @ 1998-08-14 11:11:15 by sof]
[ghc-hetmet.git] / ghc / compiler / types / Type.lhs
index 6973687..5b73eeb 100644 (file)
@@ -15,7 +15,7 @@ module Type (
        mkSynTy, isSynTy,
 
        mkForAllTy, mkForAllTys, splitForAllTy_maybe, splitForAllTys, 
-       applyTy, applyTys,
+       applyTy, applyTys, isForAllTy,
 
        TauType, RhoType, SigmaType, ThetaType,
        isTauTy,
@@ -333,6 +333,11 @@ splitForAllTy_maybe (SynTy _ ty)        = splitForAllTy_maybe ty
 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
@@ -654,7 +659,7 @@ match ty1       (SynTy _ ty2) k = match ty1 ty2 k
 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}