Is there any way to force operator precedence in Scala like you do in Haskell with $?
For example, in Haskell, you have:
a b c = ((a b) c)
and
a $ b c = a (b c)
Is there a similar way to do this in Scala? I know Scala doesn’t have operators per se, but is there a way to achieve a similar effect?
infix vs . notation is often used in a similar fashion to control precedence:
Scala also has a fixed precedence ordering for operators used in infix notation:
Names can usually chosen explicitly to take advantage of this. For example,
~and^^in the standard parsers library.