Remix.run Logo
qsort 10 hours ago

I don't think that's even well-defined if you have arbitrary infix operators with arbitrary precedence and arbitrary associativity (think Haskell). If $, & and @ are operators in that order of precedence, all right-associatve. Using your notation, what is:

  a & << b $ c >> @ d
If $ is reduced below & but above @ then it's the same as:

  ((a & b) $ c) @ d
If it's reduced below both & and @ then it becomes:

  (a & b) $ (c @ d)
I think conceptualizing parentheses as "increase priority" is fundamentally not the correct abstraction, it's school brain in a way. They are a way to specify an arbitrary tree of expressions, and in that sense they're complete.
layer8 6 hours ago | parent [-]

Clearly we need left-associative and right-associative inverse parentheses.

a & )b $ c) @ d would mean ((a & b) $ c) @ d.

a & (b $ c( @ d would mean a & (b $ (c @ d)).

Combining both, a & )b $ c( @ d would mean (a & b) $ (c @ d).

;)