[Yhc] Yhc chokes on __ identifer
isaacdupree at charter.net
Wed Oct 25 16:27:00 EDT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Neil Mitchell wrote:
>> > 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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v184.108.40.206 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the Yhc