[project @ 2002-02-11 09:27:21 by simonpj]
authorsimonpj <unknown>
Mon, 11 Feb 2002 09:27:22 +0000 (09:27 +0000)
committersimonpj <unknown>
Mon, 11 Feb 2002 09:27:22 +0000 (09:27 +0000)
commit2dd1686ba8bf463dae9cb438c2147b44cf8a6ba1
tree38a3c80a363b48d617567d44f4fae3d503cda282
parent905964fc12e0922b9713e9451019aeedb5cd1618
[project @ 2002-02-11 09:27:21 by simonpj]
------------------------------
Towards kinded data type decls
------------------------------

Move towards being able to have 'kinded' data type decls.
The burden of this commit, though, is to tidy up the parsing
of data type decls.  Previously we had

data ctype '=' constrs

where the 'ctype' is a completetely general polymorphic type.
forall a. (Eq a) => T a

Then a separate function checked that it was of a suitably restricted
form.  The reason for this is the usual thing --- it's hard to tell
when looking at

data Eq a => T a = ...

whether you are reading the data type or the context when you have
only got as far as 'Eq a'.

However, the 'ctype' trick doesn't work if we want to allow

data T (a :: * -> *) = ...

So we have to parse the data type decl in a more serious way.
That's what this commit does, and it makes the grammar look much nicer.
The main new producion is tycl_hdr.
ghc/compiler/parser/ParseUtil.lhs
ghc/compiler/parser/Parser.y
ghc/compiler/parser/RdrHsSyn.lhs