Why “**” does not bind more tightly than negation in OCaml?

Operator precedence is syntax-directed in OCaml, which means that the first character of the function identifier (and whether it's unary or binary) determines the operator precedence according to a fixed sequence. Contrast this with languages like Haskell, where the operator precedence can be specified at function definition regardless of which characters are used to form the function identifier.

This is not always correct and irrelevant to the question. For example, ** has higher precedence than *, even though they start with the same character; and unary minus has higher precedence than subtraction, even though they use the same character. In fact, the OP's problem is that unary minus is in fact higher precedence than both multiplication and exponentiation in OCaml; which could not be arrived at if you assumed that unary minus has the same precedence as subtraction.

– newacct Jun 2 '09 at 18:52 Section 6.7 of the OCaml manual has the table of operator precedences. All the binary operators have lower precedence than the unary operators (excepting the record, array and string projection binary operators). To get the standard order of arithmetic operations, and still allow programmers to define their own operators, OCaml would need some additional language features that it doesn't have, and operators would not be syntax-directed anymore.

– james woodyatt Jun 2 '09 at 19:06.

As the very page you quote says, "The order in which the unary operator − (usually read "minus") acts is often problematical. " -- it quotes Excel and bc as having the same priority for it as O'CAML, but also says "In written or printed mathematics" it works as in Python. So, essentially, there's no universal consensus on this specific issue.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions