Wang Meng writes: : | > class Foo n | > data Erk n = Foo n => Erk | | test.hs:53: | All of the type variables in the constraint `Foo n' are already in | scope | (at least one must be universally quantified here) : | Is there any reason for this error? I think it implies that the 'Foo n =>' must follow the 'data' keyword, because there is no 'forall n .' to hold it on the right hand side of the '='. That is, data Foo n => Erk n = Erk But beware that you can still construct values of type Erk n, even when n is not in Foo: class Foo n data Foo n => Erk n = Erk test = case Erk :: Erk () of -- () is not an instance of Foo Erk -> "Unrestricted!" See John Hughes's paper "Restricted Datatypes in Haskell" for more. http://www.md.chalmers.se/~rjmh/Papers/restricted-datatypes.ps Regards, Tom