Re: Bug in PAKCS data inspection ¿?

From: Wolfgang Lux <wlux_at_uni-muenster.de>
Date: Thu, 25 Oct 2007 10:20:44 +0200

Juan Carlos González Moreno wrote:

> The question is why PAKCS no detect that the problem is with data
> definition ¿?
>
> data Seq a = a | a :< Seq a

While this error may look obvious to you, it isn't so. In fact, there
is not
really an error in the declaration. When parsing the first
alternative of the
data declaration, the parser looks for
   DataConstrID SimpleTypeExpr_1 ... SimpleTypeExpr_n
Thanks to the absence of a capitalization convention in Curry, the
lower case a
is accepted as a valid data constructor identifier. It does not
matter that a
type variable with the same name is in scope because type identifiers
and value
identifiers live in different name spaces.

<shameless plug>
MCC can report case mode violations of the kind above. For instance,
if you compile
the module with MCC's -Whaskell option, you get the warning

"Test.curry", line 2.14: Warning: name of data constructor a starts
with a lower case letter

</shameless plug>

Regards
Wolfgang

PS: Thanks for the example. IMHO, it is just another good argument to
enforce
a capitalization convention in Curry.

_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Do Okt 25 2007 - 12:24:51 CEST

This archive was generated by hypermail 2.3.0 : Do Jun 20 2024 - 07:15:09 CEST