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
instance Sequence [] a where single x = [x]


I cannot move the constraint to the class context because it would
force  Eq a  on all Sequence methods. I cannot have  class Member c
(where c has kind *->*) because it is used differently in other places.

Hugs does accept the above definitions.

Could this restriction be removed in ghc please?

-- 
 __("<  Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/            GCS/M d- s+:-- a23 C+++$ UL++>++++$ P+++ L++>++++$ E-
  ^^                W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP+ t
QRCZAK                5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-


Reply via email to