GADT fixes
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>
Sun, 6 Aug 2006 21:20:26 +0000 (21:20 +0000)
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>
Sun, 6 Aug 2006 21:20:26 +0000 (21:20 +0000)
Wed Jul 26 06:00:53 EDT 2006  kevind@bu.edu

compiler/hsSyn/HsUtils.lhs
compiler/types/FunDeps.lhs

index d9c45e6..50d12a3 100644 (file)
@@ -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}
index 1534dc6..0d7eb24 100644 (file)
@@ -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])