X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcDeriv.lhs;h=82a6d2633288aeb94a6530fe49729094e8c5b69e;hb=cb90040a7e66ca608fec5cee59c3bd137c8b266c;hp=938d55cac3db6afd5bff5bc7e51f36181d89ccd9;hpb=4ff9f4f86846ef2b7231530b8d84c7d568a3e07c;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcDeriv.lhs b/ghc/compiler/typecheck/TcDeriv.lhs index 938d55c..82a6d26 100644 --- a/ghc/compiler/typecheck/TcDeriv.lhs +++ b/ghc/compiler/typecheck/TcDeriv.lhs @@ -49,7 +49,7 @@ import Var ( TyVar, tyVarKind, idType, varName ) import VarSet ( mkVarSet, subVarSet ) import PrelNames import SrcLoc ( srcLocSpan, Located(..) ) -import Util ( zipWithEqual, sortLt, notNull ) +import Util ( zipWithEqual, sortLe, notNull ) import ListSetOps ( removeDups, assocMaybe ) import Outputable import Bag @@ -529,9 +529,10 @@ mkDataTypeEqn tycon clas -- data T a b = ... deriving( Typeable ) -- gives -- instance Typeable2 T where ... + -- Notice that: -- 1. There are no constraints in the instance -- 2. There are no type variables either - -- 2. The actual class we want to generate isn't necessarily + -- 3. The actual class we want to generate isn't necessarily -- Typeable; it depends on the arity of the type do { real_clas <- tcLookupClass (typeableClassNames !! tyConArity tycon) ; dfun_name <- new_dfun_name real_clas tycon @@ -713,7 +714,7 @@ solveDerivEqns orig_eqns = addSrcSpan (srcLocSpan (getSrcLoc tc)) $ addErrCtxt (derivCtxt (Just clas) tc) $ tcSimplifyDeriv tyvars deriv_rhs `thenM` \ theta -> - returnM (sortLt (<) theta) -- Canonicalise before returning the soluction + returnM (sortLe (<=) theta) -- Canonicalise before returning the soluction mk_deriv_dfun (dfun_name, clas, tycon, tyvars, _) theta = mkDictFunId dfun_name tyvars theta