Tips for golfing in Scala 3 What general tips do you have for golfing in Scala 3? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Scala 3 (e.g. &quot;remove comments&quot; is not an answer). Please post one tip per answer.
Also see Tips for golfing in Scala
Use parameter untupling
Parameter untupling allows you to write functions accepting a single tuple as input as if they were functions accepting 2 parameters. Basically, you can replace these
list.map{case(a,b)=&gt;a+b}
//and
list.map{case(a,b)=&gt;Seq(a,b)}
//or
list.map(t=&gt;t._1+t._2)
//and
list.map(t=&gt;Seq(t._1,t._2))

with this, which is both shorter and more beautiful.
list.map(_+_)
//and
list.map(Seq(_,_))