summaryrefslogtreecommitdiff
path: root/ghc/compiler
diff options
context:
space:
mode:
authorsof <unknown>1998-04-06 18:35:24 +0000
committersof <unknown>1998-04-06 18:35:24 +0000
commit7884da81852962202366fe8470f5cc5bb9b70699 (patch)
treef9aeb35d51c10d9f816c453679df7ba853af4470 /ghc/compiler
parentca2788ca9762d04e0937c3c88c91a9e30976dfde (diff)
downloadhaskell-7884da81852962202366fe8470f5cc5bb9b70699.tar.gz
[project @ 1998-04-06 18:35:24 by sof]
new function: isForAllTy
Diffstat (limited to 'ghc/compiler')
-rw-r--r--ghc/compiler/types/Type.lhs7
1 files changed, 6 insertions, 1 deletions
diff --git a/ghc/compiler/types/Type.lhs b/ghc/compiler/types/Type.lhs
index 6973687816..3273b6081a 100644
--- a/ghc/compiler/types/Type.lhs
+++ b/ghc/compiler/types/Type.lhs
@@ -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