
1 Aug
2007
1 Aug
'07
3:30 p.m.
Philippa Cowderoy wrote:
On Wed, 1 Aug 2007, Simon Marlow wrote:
I'm rather attached to the convention I use, which is
- CamelCase for exported identifiers - underscores otherwise <snip> Yes I'm aware that a single-word identifier is the same in both conventions; it's not perfect.
How about _nonexportedIdentifier or something similar?
Leading underscores are used in pattern matches to indicate to GHC that unused names like '_foo' should not cause a warning to be printed. Otherwise the warning is turned off by using just '_' but that erases the readability of using an actual name. Thus: take _ [] = [] -- no warning take n [] = [] -- warning that n is unused take _n [] = [] -- no warning