X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypes%2FType.lhs;h=7c05b6d8c480a3bec6cd105fd619f7d3ccbb9003;hp=bad6144a6d1a60c7e5d85a41fc53821f1ba155ec;hb=9da4639011348fb6c318e3cba4b08622f811d9c4;hpb=a6590d2197b48f7eedee610a95d262d43b517f49 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,