From: Manuel M T Chakravarty Date: Sun, 6 Aug 2006 21:20:26 +0000 (+0000) Subject: GADT fixes X-Git-Tag: After_FC_branch_merge~146 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=df540a334232b9f2da702e48e1ebaf4b289997bc GADT fixes Wed Jul 26 06:00:53 EDT 2006 kevind@bu.edu --- diff --git a/compiler/hsSyn/HsUtils.lhs b/compiler/hsSyn/HsUtils.lhs index d9c45e6..50d12a3 100644 --- a/compiler/hsSyn/HsUtils.lhs +++ b/compiler/hsSyn/HsUtils.lhs @@ -397,6 +397,7 @@ collectl (L l pat) bndrs go (TypePat ty) = bndrs go (DictPat ids1 ids2) = map noLoc ids1 ++ map noLoc ids2 ++ bndrs + go (CoPat _ pat ty) = collectl (noLoc pat) bndrs \end{code} \begin{code} diff --git a/compiler/types/FunDeps.lhs b/compiler/types/FunDeps.lhs index 1534dc6..0d7eb24 100644 --- a/compiler/types/FunDeps.lhs +++ b/compiler/types/FunDeps.lhs @@ -1,4 +1,4 @@ -% + % (c) The GRASP/AQUA Project, Glasgow University, 2000 % \section[FunDeps]{FunDeps - functional dependencies} @@ -20,6 +20,7 @@ import Var ( TyVar ) import Class ( Class, FunDep, pprFundeps, classTvsFds ) import TcGadt ( tcUnifyTys, BindFlag(..) ) import Type ( substTys, notElemTvSubst ) +import Coercion ( isEqPred ) import TcType ( Type, PredType(..), tcEqType, predTyUnique, mkClassPred, tyVarsOfTypes, tyVarsOfPred ) import InstEnv ( Instance(..), InstEnv, instanceHead, classInstances, @@ -219,8 +220,9 @@ NOTA BENE: \begin{code} improve inst_env preds - = [ eqn | group <- equivClassesByUniq (predTyUnique . fst) preds, + = [ eqn | group <- equivClassesByUniq (predTyUnique . fst) (filterEqPreds preds), eqn <- checkGroup inst_env group ] + where filterEqPreds = filter (not . isEqPred . fst) ---------- checkGroup :: (Class -> [Instance])