[Yhc] Yhc chokes on __ identifer

Isaac isaacdupree at charter.net
Wed Oct 25 16:27:00 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Neil Mitchell wrote:
> Hi
> 
>> > Anyone want the -underscore flag to stick around, and not just be the
>> > default which can't be turned off?
>>
>> It depends whether you want to claim Haskell'98 compatibility or not.
>> Haskell-prime is likely to make yhc's default behaviour with underscores
>> the new standard however.
> 
> Can anyone outline exactly which behaviour is which? What the
> differences are? Is one behaviour a superset of the other? Are there
> any incompatabilities?

H'98: underscore is purely considered a lowercase character (except for
`_' which is basically just a keyword).  This allows:
_Bob :: Int; _Bob = 3

default for nhc and yhc, and a likely-to-get-in proposal for
Haskell-prime, is skipping leading underscores in an identifier for the
purpose of determining case.  This allows:
type _Bob = Int

Each example would be a syntax error in the other underscore-treatment.
 It makes no difference except for identifiers that start with
underscores not followed by a lowercase letter.  The proposed/nhc/yhc
default behavior is useful because leading underscore also signifies
"unused", which should be possible to do even for type/constructor/class
names.

Isaac
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFP8iUHgcxvIWYTTURApsiAJ4jNBFY4Oth5hUmOPyR3XdNmoMc1QCguce2
Q+JzdoEObQ6h9snlKAo0MYM=
=+IZU
-----END PGP SIGNATURE-----


More information about the Yhc mailing list