I have two questions about the operator desugaring table in the tutorial.
!f x y
desugars to Bool.not (f x y)
, and -f x y
desugars to Num.neg (f x y)
, but at the moment they desugar to Bool.not f x y
and Num.neg f x y
respectively. Which one is incorrect?It shows bit shift operators which aren't in the language. Are they planned, or were they at one point and is the table out of date
I think they were planned but I'm not sure if they still are, I'll update the table.
It shows that !f x y desugars to Bool.not (f x y), and -f x y desugars to Num.neg (f x y), but at the moment they desugar to Bool.not f x y and Num.neg f x y respectively. Which one is incorrect?
I think the brackets are just for clarity for the reader, the order of application is the same for the compiler (I think).
Anton said:
I think the brackets are just for clarity for the reader, the order of application is the same for the compiler (I think).
I don't think it is the same. At the moment, the compiler does (Bool.not f) x y
, not Bool.not (f x y)
. If f is a function, it will be a compiler error. I don't know which of the two is best, but the table is not doing the same as the compiler if I am correct
You are correct, elm also does it like our current implementation, so I'm just going to remove the !f x y
and -f x y
from the table
Yeah i think the example needs parens and is just a mistake
Last updated: Jul 06 2025 at 12:14 UTC