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)
- RE: functional dependency + subclass Ross Paterson
- RE: functional dependency + subclass Mark P Jones
- Re: functional dependency + subclass Ross Paterson
