It seems reasonable to me, and GHC is happy. Here's a working example: Simon class MyClass a b where foo :: a -> b -> Int data Special = forall b. (MyClass Int b)=> MkSpecial b data General a = forall b. (MyClass a b)=> MkGeneral b instance MyClass Int Bool where foo x False = -x foo x True = x xs :: [General Int] xs = [MkGeneral True, MkGeneral False] main = print [foo (3::Int) x | MkGeneral x <- xs] | -----Original Message----- | From: Ashley Yakeley [mailto:ashley@semantic.org] | Sent: 29 March 2001 10:47 | To: Haskell List | Subject: Parameterising Class Constraints in Existential Types | | | Is this valid (extended) Haskell? | | -- | class MyClass a b where | foo :: a -> b -> Int | | data Special = forall b. (MyClass Int b)=> MkSpecial b | data General a = forall b. (MyClass a b)=> MkGeneral b | -- | | Hugs complains about the 'General' line but has no problem with the | 'Special' line... | | -- | Ashley Yakeley, Seattle WA | | | _______________________________________________ | Haskell mailing list | Haskell@haskell.org | http://www.haskell.org/mailman/listinfo/haskell |