projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ca2788c
)
[project @ 1998-04-06 18:35:24 by sof]
author
sof
<unknown>
Mon, 6 Apr 1998 18:35:24 +0000
(18:35 +0000)
committer
sof
<unknown>
Mon, 6 Apr 1998 18:35:24 +0000
(18:35 +0000)
new function: isForAllTy
ghc/compiler/types/Type.lhs
patch
|
blob
|
history
diff --git
a/ghc/compiler/types/Type.lhs
b/ghc/compiler/types/Type.lhs
index
6973687
..
3273b60
100644
(file)
--- 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,
mkSynTy, isSynTy,
mkForAllTy, mkForAllTys, splitForAllTy_maybe, splitForAllTys,
- applyTy, applyTys,
+ applyTy, applyTys, isForAllTy,
TauType, RhoType, SigmaType, ThetaType,
isTauTy,
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
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
splitForAllTys :: GenType flexi -> ([GenTyVar flexi], GenType flexi)
splitForAllTys ty = split ty ty []
where