|
|
|
|
|
by virtualwhys
3321 days ago
|
|
One advantage of significant whitespace is that it may enable a very concise (G)ADT notation: enum Tree[T]
Branch(t: Tree[T])
Leaf(t: T)
Compare that with preset day Scala: sealed trait Tree[T]
case class Branch(t: Tree[T]) extends Tree[T]
case class Leaf(t: T) extends Tree[T]
In general with this proposal the `case` keyword could be implied in any pattern matching block. That alone would be a big win wrt to reducing keyword noise, something the MLs have enjoyed for decades. |
|