Brian Hulley wrote :
> Possibly you meant to write:
> instance IsFoo a => Class2 a a
> instance Class2 (Bar a) a
Yes, in principle that illustrates the idea.
However I don't see the major difference from constraining the
'a' to the IsFoo class, as in
instance IsFoo a => Class2 (Bar a) a
This wont automatically imply 'Bar a' to instantiate IsFoo.
As pointed out, the problem arises due to the fact that it is possible
to write an instance for Bar a, which would then violate the FunDep constraint.
So, since the compiler does not control this, I'll better remove the FunDep.
Thanks
/Joel