Changes between Version 4 and Version 5 of Underscore


Ignore:
Timestamp:
Apr 13, 2008 5:18:54 PM (7 years ago)
Author:
ross@…
Comment:

possible grammar

Legend:

Unmodified
Added
Removed
Modified
  • Underscore

    v4 v5  
    1 = Treatment of names beginning with underscore =
     1= Caseless Underscore =
    22
    3 It is a convention that the compiler will not warn about unused variables that begin with an underscore. An underscore also counts as a lower case letter meaning that you cannot start type, class, or data constructors with it.
     3It is a convention that the compiler will not warn about unused variables that begin with an underscore. In Haskell 98, an underscore also counts as a lower case letter meaning that you cannot start type, class, or data constructors with it.
    44
    5 == proposal ==
     5== Proposal ==
    66
    77Make underscore 'caseless' meaning when deciding whether a name is a constructor or not, look through underscores. so
     
    1717The leading underscore convention is not only useful as a way to suppress warnings, but as a form of documentation that we expect a name to be unused so being able to use it in these cases would be helpful.
    1818
    19 == implementations ==
     19== Change to the Report ==
     20
     21Change the productions for ''varid'' and ''conid'' in section 2.4 to
     22{{{
     23varid -> ({ _ } small {small | large | digit | _ | ' })<reservedid>
     24conid -> { _ } large {small | large | digit | _ | ' }
     25}}}
     26In the above, there are no underscore-only identifiers, but single underscore is a reservedid.
     27
     28For full backward compatibility, we would need to allow underscore-only varids, changing the first production to:
     29{{{
     30varid -> ({ _ } ( _ | small {small | large | digit | _ | ' }))<reservedid>
     31}}}
     32
     33== Implementations ==
    2034
    2135Caseless underscore is implemented in nhc98 by default, H'98 behaviour requires the -underscore option.