
I have a Haskell program that defines the value __ as __ = Prelude.error "Logical or arity value used" Yhc seems unhappy with this name. Any reason for this? Can Yhc be made to accept this?

Hi Russell
I have a Haskell program that defines the value __ as
__ = Prelude.error "Logical or arity value used"
I believe there is an option that handles underscores in some weird and wonderful way, I'll dig into this tomorrow. The reason its going wrong is because it can't tell if ___ is an upper or lower case thingy, it tells by looking at the first non-_ character, which in this case is none. I think Haskell' makes a ruling on what this should mean, so I guess we should follow that. Anyone know what it is offhand? Thanks Neil

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Neil Mitchell wrote:
I think Haskell' makes a ruling on what this should mean, so I guess we should follow that. Anyone know what it is offhand?
http://hackage.haskell.org/trac/haskell-prime/wiki/Underscore "we can either treat identifiers containing only underscores as lowercase names or invalid depending on how important the ability to obfscusiate code is to us..." Seems it isn't quite decided yet, but it's not going to be treated as an uppercase identifier :) Isaac -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFPoXZHgcxvIWYTTURAg8MAKCppDSoFoNeYse0ktpCkc003qmBMACgjQGq qWVr+P5VM/GJBqjaGbMAmHQ= =Tl2T -----END PGP SIGNATURE-----

Hi, C:\Temp>yhc Main.hs -underscore Compiling Main ( Main.hs ) yhc: Prelude.head: empty list Answer: the -underscore flag enables this behaviour, the -underscore flag is broken, since its a real crash I can debug this pretty easy - i even have half an idea where its happening. Anyone want the -underscore flag to stick around, and not just be the default which can't be turned off? For that matter: Compliance Options: -underscore Enable H'98 underscore-is-lower-case (default=off) -puns Enable pre-98 named-field puns (default=on) -98 Haskell 98 compliance (default=off) Why is -98 off, why is -puns on (what are puns!!!) and lets kill this -underscore option. The n+k option died, others deserve to die too :) Thanks Neil

"Neil Mitchell"
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.
For that matter: Compliance Options: -underscore Enable H'98 underscore-is-lower-case (default=off) -puns Enable pre-98 named-field puns (default=on) -98 Haskell 98 compliance (default=off)
Why is -98 off, why is -puns on (what are puns!!!) and lets kill this -underscore option. The n+k option died, others deserve to die too :)
The option -98 is just a collective switch to say -underscore -nopuns in a shorter way. It is off by default because of user demand. Named field puns were a feature of Haskell-1.3 that went away in Haskell'98, but some users liked them and campaigned for their reinstatement. Regards, Malcolm

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?
The option -98 is just a collective switch to say -underscore -nopuns in a shorter way. It is off by default because of user demand. Named field puns were a feature of Haskell-1.3 that went away in Haskell'98, but some users liked them and campaigned for their reinstatement.
Are they in GHC? Hugs? If not I guess we'll kill them too, since I guess no one is using them. With -underscore as well, we might be able to give up on -98, but its a nice flag to keep, I guess. Thanks Neil

-----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-----

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I wrote: ... and the Haskell-98 treatment of leading underscores is good just because it's simple and it makes it obvious what case a symbol made up of all underscores is. That's all, I think. Isaac -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFP8mfHgcxvIWYTTURAo1GAKC8d9vb+aoY0qTlXv1/1jN2S1mpcgCgw7ko 6IZWa1CYCVnSUvHd78gfF/M= =g07a -----END PGP SIGNATURE-----
participants (4)
-
Isaac
-
Malcolm Wallace
-
Neil Mitchell
-
Russell O'Connor