I might just be very confused about how instance definitions are stored, but
what is the difference between the type variables stored with a specific
instance (that one can get with is_tvs) and the type variables stored with the
class?
They are utterly un-connected! Eg
class C a where ...
instance (Eq p, Ord q) => C (p,q) where ...
There is no need for the type variables of the class ('a' in this case) to
match, either in name or number, the type variables of the instance ('p', 'q'
in this case).
If you want the signatures of the instances, just get the DFunID of the
instance (use InstEnv.instanceDFunId). The type of that Id gives you the
signature of the instance. Eg. for the above instance, the dfunid has type
forall p,q. (Eq p, Ord q) => C (p,q)
Also, the error messages seem to be coming from trying to do this for type
class instances that involve type variables in some context. (For example,
(Show a, Show b, Show c) => Show ((,,) a b c).) Any suggestions about what to
watch out for when dealing with these?
I'm sorry I just can't figure out what you are asking here.
Simon
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc