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) where
>         foo = undefined

> instance (FooBar a, FD b c) => FooBar (Either a b) where
>         bar = undefined

but Hugs says

ERROR "foobar.hs" (line 10): Cannot build superclass instance
*** Instance            : FooBar (Either a b)
*** Context supplied    : (FooBar a, FD b c)
*** Required superclass : Foo (Either a b)

Reply via email to