%
+% (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}
-- This comparison is used exclusively (I think) for the
-- finite map built in TcSimplify
cmpPredX env (ClassP c1 tys1) (ClassP c2 tys2) = (c1 `compare` c2) `thenCmp` cmpTypesX env tys1 tys2
-cmpPredX env (IParam _ _) (ClassP _ _) = LT
-cmpPredX env (ClassP _ _) (IParam _ _) = GT
cmpPredX env (EqPred ty1 ty2) (EqPred ty1' ty2') = (cmpTypeX env ty1 ty1') `thenCmp` (cmpTypeX env ty2 ty2')
+
+-- Constructor order: IParam < ClassP < EqPred
+cmpPredX env (IParam {}) _ = LT
+cmpPredX env (ClassP {}) (IParam {}) = GT
+cmpPredX env (ClassP {}) (EqPred {}) = LT
+cmpPredX env (EqPred {}) _ = GT
\end{code}
PredTypes are used as a FM key in TcSimplify,