Wed, 28 Jun 2000 04:36:01 -0700, Simon Peyton-Jones <[EMAIL PROTECTED]> pisze:
> Why can't you have
>
> class Eq a => Member c a | c -> a where member :: Eq a => c -> a -> Bool
>
> OK, so then sequences require Eq on elements, but since Member is a
> superclass of sequence, every sequence has a
Original Message-
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
| Sent: 27 June 2000 14:30
| To: [EMAIL PROTECTED]
| Subject: Method contexts
|
|
| The restriction that a method context must constrain at least one
| type variable that is quantified there has biten me:
|
|
| class
The restriction that a method context must constrain at least one
type variable that is quantified there has biten me:
class Member c a | c -> a where member :: Eq a => c -> a -> Bool
class Member (s a) a => Sequence s a where single :: a -> s a
instance Member [a] a where member s a = elem a s