This is a recently-introduce function, which was returning
a [Name], being the names of the dfuns. But what you really
want (obviously!) is the ClassInstances, and we have a TH type
for that.
This is an API change, so don't merge into GHC 7.0. But it's
a new part of TH which is still settling down.
Fixes Trac #4863.
%************************************************************************
\begin{code}
%************************************************************************
\begin{code}
-lookupClassInstances :: TH.Name -> [TH.Type] -> TcM [TH.Name]
+lookupClassInstances :: TH.Name -> [TH.Type] -> TcM [TH.ClassInstance]
lookupClassInstances c ts
= do { loc <- getSrcSpanM
; case convertToHsPred loc (TH.ClassP c ts) of {
lookupClassInstances c ts
= do { loc <- getSrcSpanM
; case convertToHsPred loc (TH.ClassP c ts) of {
-- Now look up instances
; inst_envs <- tcGetInstEnvs
; let (matches, unifies) = lookupInstEnv inst_envs cls tys
-- Now look up instances
; inst_envs <- tcGetInstEnvs
; let (matches, unifies) = lookupInstEnv inst_envs cls tys
- dfuns = map is_dfun (map fst matches ++ unifies)
- ; return (map reifyName dfuns) } } }
+ ; mapM reifyClassInstance (map fst matches ++ unifies) } } }
where
doc = ptext (sLit "TcSplice.classInstances")
\end{code}
where
doc = ptext (sLit "TcSplice.classInstances")
\end{code}