Method contexts

Hannah Schroeter uk1o at rz.uni-karlsruhe.de
Sat Feb 10 10:36:52 EST 2001


Hello!

On Sun, Jan 28, 2001 at 07:22:09PM +0000, Marcin 'Qrczak' Kowalczyk wrote:
> Sun, 28 Jan 2001 19:41:15 +0100, Hannah Schroeter <uk1o at rz.uni-karlsruhe.de> pisze:

> > Why can't you write:

> > class Eq k => Member c k where
> >   member :: c -> k -> Bool

> > > class Member c a => Seq c a

> > instance Eq a => Member [a] a where
> >   ...

> > > instance Seq [a] a

> Because the last instance is then illegal: requires Eq a in the
> context, which I obviously don't want.

Somehow I don't understand this. Eq a is required for Member [a] a,
which is requred for Seq [a] a because of the superclass constraint
for Seq. So, why is Member c a superclass of Seq c a, and Eq a superclass
of Member c a and still you want a Seq c a instance where a has NO
Eq a constraint?

> [...]

Kind regards,

Hannah.




More information about the Glasgow-haskell-bugs mailing list