Hi Ross,
| I expected the following to work:
|
| > class Foo x where foo :: x
| > class Foo x => FooBar x where bar :: x
| > class FD b c | b -> c where fun :: b -> c
| > instance (Foo a, FD b c) => Foo (Either a b)
| > instance (FooBar a, FD b c) => FooBar (Either a b)
Your expectations seem reasonable, but they are not supported
by the underlying theory! That, of course, means one of two
things: Either there's a fundamental problem/unsoundness with
supporting this kind of example, or otherwise the theory is not
as general as it could be. Jeff Lewis and I have been talking
about this a fair bit, and are strongly inclined to believe that
it is the latter ... but we don't yet know for sure. As evidence
for the latter, Jeff has put together a patch that seems to work
well and give the kind of behavior that you are looking for.
I think that he has already mailed a copy to you ... if you don't
find any bugs, then there's a good chance that it is ok :-)
In the meantime, until we figure it out one way or the other,
it remains as a nice example of practice driving theory ...
All the best,
Mark