[project @ 2000-12-19 08:37:18 by simonpj]
authorsimonpj <unknown>
Tue, 19 Dec 2000 08:37:18 +0000 (08:37 +0000)
committersimonpj <unknown>
Tue, 19 Dec 2000 08:37:18 +0000 (08:37 +0000)
Use classesOfPreds instead of DIY

ghc/compiler/typecheck/Inst.lhs

index 6342259..d0d44cf 100644 (file)
@@ -60,7 +60,7 @@ import PprType        ( pprPred )
 import Type    ( Type, PredType(..), 
                  isTyVarTy, mkDictTy, mkPredTy,
                  splitForAllTys, splitSigmaTy, funArgTy,
-                 splitMethodTy, splitRhoTy,
+                 splitMethodTy, splitRhoTy, classesOfPreds,
                  tyVarsOfType, tyVarsOfTypes, tyVarsOfPred,
                  tidyOpenType, tidyOpenTypes
                )
@@ -724,7 +724,7 @@ lookupSimpleInst clas tys
        -> returnNF_Tc (Just (substClasses (mkSubst emptyInScopeSet tenv) theta'))
         where
           (_, theta, _) = splitSigmaTy (idType dfun)
-          theta' = map (\(Class clas tys) -> (clas,tys)) theta
+          theta'        = classesOfPreds theta
 
       other  -> returnNF_Tc Nothing
 \end{code}