In Scala 3 you can call higher order methods without braces
numbers.map: n =>
n * 2
This is nice, but fails when the method is named with a symbol.
extension [A](a: A)
inline def |>[B](inline f: A => B): B = f(a)
10 |>(n => n + 5)
// ✅
10 |>: n =>
n + 5
// ❌ not a legal formal parameter for a function literal
10 |> : n =>
n + 5
// ❌ even fails with the extra space.
10 `|>`: n =>
n + 5
// ✅ backticks work, but no one wants to do that.
Scala interprets : as part of the identifier name, |>: rather than |>.
I want to be consistent in my preference for whitespace style in my codebase, and pipe is a scenario where a symbolic operator is worthwhile. Scala supports whitespace, and Scala supports symbolic operators. Can we do anything to improve their unison in this edge case?