[commit: ghc] imp-param-class: Change `isIPPred` to test for the new `IP` class. (2bc826b)
Iavor Diatchki
diatchki at galois.com
Sat May 26 02:31:46 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : imp-param-class
http://hackage.haskell.org/trac/ghc/changeset/2bc826b0f86103c5163cdc5bf99c533cf06bdcb6
>---------------------------------------------------------------
commit 2bc826b0f86103c5163cdc5bf99c533cf06bdcb6
Author: Iavor S. Diatchki <diatchki at galois.com>
Date: Fri May 25 17:26:58 2012 -0700
Change `isIPPred` to test for the new `IP` class.
>---------------------------------------------------------------
compiler/types/Type.lhs | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs
index 62cc7bb..97e869b 100644
--- a/compiler/types/Type.lhs
+++ b/compiler/types/Type.lhs
@@ -157,7 +157,7 @@ import Class
import TyCon
import TysPrim
import {-# SOURCE #-} TysWiredIn ( eqTyCon, mkBoxedTupleTy )
-import PrelNames ( eqTyConKey )
+import PrelNames ( eqTyConKey, ipClassName )
-- others
import {-# SOURCE #-} IParam ( ipTyCon )
@@ -851,9 +851,10 @@ isClassPred ty = case tyConAppTyCon_maybe ty of
isEqPred ty = case tyConAppTyCon_maybe ty of
Just tyCon -> tyCon `hasKey` eqTyConKey
_ -> False
+
isIPPred ty = case tyConAppTyCon_maybe ty of
- Just tyCon | Just _ <- tyConIP_maybe tyCon -> True
- _ -> False
+ Just tyCon -> tyConName tyCon == ipClassName
+ _ -> False
\end{code}
Make PredTypes
More information about the Cvs-ghc
mailing list