%
+% (c) The University of Glasgow 2006
% (c) The GRASP/AQUA Project, Glasgow University, 1998
%
-\section[Type]{Type - public interface}
+Type - public interface
\begin{code}
module Type (
import TypeRep
-- friends:
-import Var ( Var, TyVar, tyVarKind, tyVarName,
- setTyVarName, setTyVarKind, mkWildCoVar )
+import Var
import VarEnv
import VarSet
-import OccName ( tidyOccName )
-import Name ( NamedThing(..), tidyNameOcc )
-import Class ( Class, classTyCon )
-import PrelNames( openTypeKindTyConKey, unliftedTypeKindTyConKey,
- ubxTupleKindTyConKey, argTypeKindTyConKey )
-import TyCon ( TyCon, isRecursiveTyCon, isPrimTyCon,
- isUnboxedTupleTyCon, isUnLiftedTyCon,
- isFunTyCon, isNewTyCon, isClosedNewTyCon,
- newTyConRep, newTyConRhs,
- isAlgTyCon, tyConArity, isSuperKindTyCon,
- tcExpandTyCon_maybe, coreExpandTyCon_maybe,
- tyConKind, PrimRep(..), tyConPrimRep, tyConUnique,
- isCoercionTyCon
- )
+import OccName
+import Name
+import Class
+import PrelNames
+import TyCon
-- others
-import StaticFlags ( opt_DictsStrict )
-import Util ( mapAccumL, seqList, lengthIs, snocView, thenCmp, isEqual, all2 )
+import StaticFlags
+import Util
import Outputable
-import UniqSet ( sizeUniqSet ) -- Should come via VarSet
-import Maybe ( isJust )
+import UniqSet
+
+import Data.Maybe ( isJust )
\end{code}
| is_co_var = setTyVarKind old_var (substTy subst kind)
| otherwise = old_var
kind = tyVarKind old_var
- is_co_var = isCoercionKind kind
+ is_co_var = isCoVar old_var
\end{code}
----------------------------------------------------
| isSubArgTypeKind k = liftedTypeKind
| otherwise = k
-isCoercionKind :: Kind -> Bool
--- All coercions are of form (ty1 :=: ty2)
--- This function is here rather than in Coercion,
--- because it's used by substTy
-isCoercionKind k | Just k' <- kindView k = isCoercionKind k'
-isCoercionKind (PredTy (EqPred {})) = True
-isCoercionKind other = False
-
isEqPred :: PredType -> Bool
isEqPred (EqPred _ _) = True
isEqPred other = False