An identifier may be given infix status by the infix or
infixr directive, which may occur as a declaration. If identifier
id has infix status, then exp id
exp
id
(
exp,
exp)
or id{1=
exp,2=
exp}
would otherwise occur.
Infix identifiers in patterns are analogous. On the other hand, an
occurrence of a qualified identifier, or any identifier prefixed by
op, is treated as non-infixed. The form of the fixity directives
is as follows (
where d
indicating binding precedence. A higher value of d indicates
tighter binding; the default is
0
. Fixity directives are
subject to the usual scope rules governing visibility of identifiers
declared inside let and local.
Mixed left-associative operators of the same precedence associate to the left, mixed right-associative operators of the same precedence associate to the right, and it is illegal to mix left- and right-associative operators of the same precedence.