I'm a bit reluctant to do this.   People (including me) often say things
like:

data Foo = Camel Camel
         |  Rat Rat 
         |  ...


data Camel = Short ..
             |  Tall ..


So here Foo introduces a constructor for a type that
already exisits (and might be imported).  You might say that
the language should prohibit this, but it doesn't.

I suppose we could add -fwarn-type-constructor-reuse, but it had
better not be on by default.

If several people want this it would not be hard to add

Simon

| -----Original Message-----
| From: Wojciech Moczydlowski, Jr [mailto:[EMAIL PROTECTED]]
| Sent: 16 April 2000 19:11
| To: [EMAIL PROTECTED]
| Subject: A proposal of new warning
| 
| 
|   I've just spent some time looking for a trivial error - I typed:
| 
| data A = Either B C
| 
| instead of 
| 
| type A = Either B C
| 
| The correctness of expression: 
| 
| data A = Int Int
| 
| seems a little strange to me, but since both ghc and hugs 
| support it, it
| has to be OK. Nevertheless, ghc could say some warning, when a type
| constructor name is the same as imported type name.
| 
| Khaliff TM                                   
| [EMAIL PROTECTED]
| 
| "Everything will change on a New Year's day."
| 
| 

Reply via email to