From the Haskell report, this is the syntax for allowed characters:
a | b a | b means a or b and
a<b> means a except b
special -> ( | ) | , | ; | [ | ] | '| { | } symbol -> ascSymbol | uniSymbol<special | _ | : | " | '> ascSymbol -> ! | # | $ | % | & | * | + | . | / | < | = | > | ? | @ \ | ^ | | | - | ~ uniSymbol -> any Unicode symbol or punctuation
Thus, characters are ASCII characters or Unicode characters, with the exception of characters in special | _ | : | " | ' special | _ | : | " | ' special | _ | : | " | ' which are reserved.
This means that the following characters cannot be used: | , ; [ ] ' { } _ : " ' | , ; [ ] ' { } _ : " '
In a few paragraphs below, the report contains a complete definition of Haskell statements:
varsym -> ( symbol {symbol | :})<reservedop | dashes> consym -> (: {symbol | :})<reservedop> reservedop -> .. | : | :: | = | \ | | | <- | -> | @ | ~ | =>
Operator characters are formed from one or more character characters, as defined above, and are lexically distinguished in two namespaces (Section 1.4):
- An operator character starting with a colon is a constructor.
- An operator character starting with any other character is a regular identifier.
Note that the colon itself, ":" is reserved exclusively for use as a Haskell List Constructor; this makes its treatment consistent with other parts of the list syntax, such as "[]" and "[a, b]".
Except for the special syntax for negating a prefix, all infix operators, although each infix operator can be used in a section to obtain partially applicable operators (see section 3.5). All standard Infix operators are just predefined characters and can be a rebound.
Riccardo T. May 11 '12 at 9:08 a.m. 2012-05-11 09:08
source share