[project @ 2004-12-22 16:58:34 by simonpj]
[ghc-hetmet.git] / ghc / compiler / types / InstEnv.lhs
index cc1c445..d0877c4 100644 (file)
@@ -9,7 +9,7 @@ The bits common to TcInstDcls and TcDeriv.
 module InstEnv (
        DFunId, InstEnv,
 
-       emptyInstEnv, extendInstEnv,
+       emptyInstEnv, extendInstEnv, extendInstEnvList,
        lookupInstEnv, instEnvElts,
        classInstances, simpleDFunClassTyCon, checkFunDeps
     ) where
@@ -69,6 +69,9 @@ classInstances (pkg_ie, home_ie) cls
                Just (ClsIE insts _) -> insts
                Nothing              -> []
 
+extendInstEnvList :: InstEnv -> [DFunId] -> InstEnv
+extendInstEnvList inst_env dfuns = foldl extendInstEnv inst_env dfuns
+
 extendInstEnv :: InstEnv -> DFunId -> InstEnv
 extendInstEnv inst_env dfun_id
   = addToUFM_C add inst_env clas (ClsIE [ins_item] ins_tyvar)