Local qualification in data types

Josef Svenningsson josefs at cs.chalmers.se
Tue Nov 11 15:24:09 EST 2003


Hi,

I'm playing around with the type system trying to encode various stuff in
it. I've gotten an error though which it would be useful to understand.

Say I have a type class:
class Foo a

and then I want a datatype like this:

data Bar a = Foo a => C1 | C2 ... | C3

This works fine syntactically but ghc says that I must have at least one
existential type variable in the constraint. Hugs doesn't require that but
has other problems....
Is there a good reason for not allowing the above?

Cheers,

	/Josef



More information about the Glasgow-haskell-users mailing list