dependent type query

Simon Peyton-Jones simonpj@microsoft.com
Sun, 20 Jan 2002 22:51:22 -0800


| >Furthermore, I can't even write:
| >
| >data (MyClass f a) =3D> MyData2 f =3D MyData2 f
|=20
| Well now this is odd. I had no trouble simulating it with this:
|=20
|   data MyData2 f =3D MyData2 f
|=20
|   mkMyData2 :: (MyClass f a) =3D> f -> MyData2 f
|   mkMyData2 =3D MyData2
|=20
| Looks like extended Haskell is being excessively restricted. Comments?

I think you are correct here. =20

But as you point out, contexts in data declarations
only restrict what programs you can write, by adding extra constraints
to
the constructors.  They have no useful purpose at all, so far as I know,
and
I wish Haskell didn't have them.

So I am disinclined to invest much effort in fixing this infelicity in
GHC's
handling of them.

Simon