Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : ghc-kinds

http://hackage.haskell.org/trac/ghc/changeset/e7263dc6326202389132ee6b247562f63c4aca77

>---------------------------------------------------------------

commit e7263dc6326202389132ee6b247562f63c4aca77
Author: Julien Cretin <g...@ia0.eu>
Date:   Tue Sep 13 10:46:53 2011 +0200

    fix isPredTy on BOX

>---------------------------------------------------------------

 compiler/types/Coercion.lhs |    2 +-
 compiler/types/Kind.lhs     |    6 +-----
 compiler/types/Type.lhs     |    8 +++++---
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/compiler/types/Coercion.lhs b/compiler/types/Coercion.lhs
index d1a9923..9199387 100644
--- a/compiler/types/Coercion.lhs
+++ b/compiler/types/Coercion.lhs
@@ -18,7 +18,7 @@ module Coercion (
 
         -- ** Predicates on Kinds
         isLiftedTypeKind, isUnliftedTypeKind, isOpenTypeKind,
-        isUbxTupleKind, isArgTypeKind, isKind, isTySuperKind, 
+        isUbxTupleKind, isArgTypeKind, isKind,
         isSuperKind, 
        mkArrowKind, mkArrowKinds,
 
diff --git a/compiler/types/Kind.lhs b/compiler/types/Kind.lhs
index 915581d..d75f694 100644
--- a/compiler/types/Kind.lhs
+++ b/compiler/types/Kind.lhs
@@ -27,7 +27,7 @@ module Kind (
 
         -- ** Predicates on Kinds
         isLiftedTypeKind, isUnliftedTypeKind, isOpenTypeKind,
-        isUbxTupleKind, isArgTypeKind, isConstraintKind, isKind, isTySuperKind,
+        isUbxTupleKind, isArgTypeKind, isConstraintKind, isKind,
         isSuperKind, noHashInKind,
         isLiftedTypeKindCon, isConstraintKindCon,
 
@@ -59,10 +59,6 @@ import Outputable
 %************************************************************************
 
 \begin{code}
-isTySuperKind :: SuperKind -> Bool
-isTySuperKind (TyConApp kc []) = kc `hasKey` tySuperKindTyConKey
-isTySuperKind _                = False
-
 -------------------
 -- Lastly we need a few functions on Kinds
 
diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs
index 71d9251..3f9885b 100644
--- a/compiler/types/Type.lhs
+++ b/compiler/types/Type.lhs
@@ -139,7 +139,7 @@ module Type (
 -- We import the representation and primitive functions from TypeRep.
 -- Many things are reexported, but not the representation!
 
-import Kind    ( kindAppResult, isTySuperKind, isSubOpenTypeKind )
+import Kind    ( kindAppResult, isSuperKind, isSubOpenTypeKind )
 import TypeRep
 
 -- friends:
@@ -776,7 +776,9 @@ noParenPred :: PredType -> Bool
 noParenPred p = isClassPred p || isEqPred p
 
 isPredTy :: Type -> Bool
-isPredTy ty = typeKind ty `eqKind` constraintKind
+isPredTy ty
+  | isSuperKind ty = False
+  | otherwise = typeKind ty `eqKind` constraintKind
 
 isClassPred, isEqPred, isIPPred :: PredType -> Bool
 isClassPred ty = case tyConAppTyCon_maybe ty of
@@ -1487,7 +1489,7 @@ typeKind (FunTy _arg res)
     -- The only things that can be after a function arrow are
     --   (a) types (of kind openTypeKind or its sub-kinds)
     --   (b) kinds (of super-kind TY) (e.g. * -> (* -> *))
-    | isTySuperKind k         = k
+    | isSuperKind k         = k
     | otherwise               = ASSERT( isSubOpenTypeKind k) liftedTypeKind 
     where
       k = typeKind res



_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to