Reputation: 3459
I'm learning about operator precedence in Haskell. Several places across the web mention that function application has higher precedence than operators, but I couldn't find a definitive source for that.
Here is one such mention from A Gentle Introduction To Haskell:
Function application has higher precedence than any infix operator
There is a section in the Haskell 98 Report that alludes to it:
normal constructor application has higher precedence than infix constructor application
Where is a definitive source? I would expect it to be included in the Haskell 98 Report, perhaps I'm not reading it correctly.
Upvotes: 2
Views: 248
Reputation: 213578
The Haskell Report is itself a definitive reference, so the quote you found is sufficient.
You can also find the same information in the grammar.
fexp -> [fexp] aexp
exp_10 -> ... | fexp
You can see that function application has precedence "10" whereas all the infix / prefix operators are 9 or lower.
Upvotes: 6