From 5574c3af65daebbb931794d84330900a3bc9aa71 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Sat, 23 Sep 2006 04:29:34 +0000 Subject: [PATCH] Complete definition of cmPredX to take account of EqPred --- compiler/types/Type.lhs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs index bad6144..7c05b6d 100644 --- a/compiler/types/Type.lhs +++ b/compiler/types/Type.lhs @@ -1028,9 +1028,13 @@ cmpPredX env (IParam n1 ty1) (IParam n2 ty2) = (n1 `compare` n2) `thenCmp` cmpTy -- 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, -- 1.7.10.4