Let f x y = x * y
. We can apply this function in two ways: f 5 6
, or, using infix notation, 5 `f` 6
. Do the operator rules apply to this last expression? What precedence will this application have? Is it just another form of function application, and so will it also have the highest precedence?
I suppose that the compiler sees this special form (due to ``
and/or the name starting with a letter(?)), and actually treats this as ordinary function application, instead of considering it an operator.
The Haskell 98 Report has a section on Operator Applications that clears it up:
As indicated by the other answers, the Report also has a section on Fixity Declarations that allows you to define your own fixity, for example:
If no explicit fixity declaration is given, as e.g.
a backticked infix function has the default fixity of
infixl 9
, so will be treated like any other infix operator with the same fixity.