I like that (although I think fewer options are better than more options), and as several others have suggested in this thread, if anything, I would lean toward making :
optional in all cases.
My current material teaches that we make braces optional by adding a colon in some cases (template declarations), and by indenting in other cases (control flow, method declarations). The distinction feels somewhat arbitrary, and the only way to learn these rules are to memorize them.
Fewer rules and more consistency means faster learning, so I would love it if template declarations did not require a colon. I know that would mean poorly indented code following a declaration would be (wrongly) associated with the declaration, but that’s a problem that’s easy to fix: fix the formatting! Beyond this fix, you can already use braces if you want to format code in non-standard ways, so catering for this audience at the expense of ergonomics for properly formatted code seems unnecessary.
Personally, I love the way declarations read without the colon character:
trait Logging
def logger: Logger
package config
val defaultConfig = Config("localhost", 452)
// Etc.
Clean, consistent, and beautiful!
This would leave only the “lambda problem”. Personally, I find parentheses acceptable providing we can define local variables, e.g.:
xs.map (x =>
val square = x * x
square)
Or possibly one could take a cue from Haskell:
xs.map \x =>
val square = x * x
square
One can already approximate this with match
:
xs.map (_ match
case x =>
val square = x * x
square)
In any case, regardless of whether or not any changes are made, I am enjoying optional braces, and I have found that many students quickly gain an appreciation for the syntax, reversing their formerly held opinions. I take that as a good sign, and a sign of things to come!