The analogy with if/else is also how I justify aligned match.
(As an aside, I just saw a comment circa 2015 on the style for the dotty project, whether else should align when there is a brace.
if (cond) {
body
} else {
other
}
Although I used the compressed style since days of C, I used aligned style encouraged on Scala 2, and as Odersky endorsed for Scala 3, years before the braces became optional.)
I find the argument from “uniformity” less persuasive, since the syntax is similar but the semantics is disparate.
There are discussions about colon syntax and how to teach it, especially with its current conveniences (special cases, so to speak):
f()
.tap: res =>
g(res)
and now
f()
.tap:
case s: String => println(s"str $s")
On serial usage, I found an old snippet match-game.scala punning on an old tv show:
def f(x: Any) =
x match {
case i: Int =>
i.toString
case x => x
}
match
case s: String => s"string $s"
case x => s"value $x"
or maybe call it “stacked” usage. The question, “Should it look like that?”, is the same as aligned else, a style matter. The syntax ought to be liberal in what it accepts. Semantics, on the other hand, should be “opinionated”. That is, Scala 3 syntax that is more expressive of semantics, such as import x.given, may be deemed opinionated or restrictive.