It's slightly odd that the built-in 2 ^ support requires spaces around ^, but if you define a custom operator ^ it doesn't. The RISC-V sail model defines operator ^ = {int_power} which means it will actually give different type checking results if you use spaces or not (because 2 ^ is understood at the type level, but int_power is just int ^ int -> int).
It's slightly odd that the built-in
2 ^
support requires spaces around^
, but if you define a customoperator ^
it doesn't. The RISC-V sail model definesoperator ^ = {int_power}
which means it will actually give different type checking results if you use spaces or not (because2 ^
is understood at the type level, butint_power
is justint ^ int -> int
).