An implication constraint can abstract over EqInsts
authorsimonpj@microsoft.com <unknown>
Sat, 27 Oct 2007 15:54:33 +0000 (15:54 +0000)
committersimonpj@microsoft.com <unknown>
Sat, 27 Oct 2007 15:54:33 +0000 (15:54 +0000)
compiler/typecheck/Inst.lhs
compiler/typecheck/TcRnTypes.lhs

index 66e72e4..fac10ab 100644 (file)
@@ -141,7 +141,7 @@ instType imp@(ImplicInst {})      = mkImplicTy (tci_tyvars imp) (tci_given imp)
 instType (EqInst {tci_left = ty1, tci_right = ty2}) = mkPredTy (EqPred ty1 ty2)
 
 mkImplicTy tvs givens wanteds  -- The type of an implication constraint
 instType (EqInst {tci_left = ty1, tci_right = ty2}) = mkPredTy (EqPred ty1 ty2)
 
 mkImplicTy tvs givens wanteds  -- The type of an implication constraint
-  = ASSERT( all isDict givens )
+  = ASSERT( all isAbstractableInst givens )
     -- pprTrace "mkImplicTy" (ppr givens) $
     -- See [Equational Constraints in Implication Constraints]
     let dict_wanteds = filter (not . isEqInst) wanteds
     -- pprTrace "mkImplicTy" (ppr givens) $
     -- See [Equational Constraints in Implication Constraints]
     let dict_wanteds = filter (not . isEqInst) wanteds
index 50199a7..9ecb943 100644 (file)
@@ -661,7 +661,7 @@ data Inst
                                    -- Includes coercion variables
                                    --   mentioned in tci_reft
        tci_reft   :: Refinement,
                                    -- Includes coercion variables
                                    --   mentioned in tci_reft
        tci_reft   :: Refinement,
-       tci_given  :: [Inst],       -- Only Dicts
+       tci_given  :: [Inst],       -- Only Dicts and EqInsts
                                    --   (no Methods, LitInsts, ImplicInsts)
        tci_wanted :: [Inst],       -- Only Dicts and ImplicInsts
                                    --   (no Methods or LitInsts)
                                    --   (no Methods, LitInsts, ImplicInsts)
        tci_wanted :: [Inst],       -- Only Dicts and ImplicInsts
                                    --   (no Methods or LitInsts)