I love that in Swift, data constructors are namespaced under their type constructor. So there's no naked `Some`, but `Option.Some`.
But it brings much more accessible syntax to something many programmers would not bother to write because it would be too verbose.
-
-
Which of the multiple syntax variations? "enum class" isn't shorter and "enum" hardly supports any Scala language "feature", e.g. methods.
-
enum List[+T] { case Nil; case ::(head: T, tail: List[T]) } vs sealed trait List[+T] case object Nil extends List[T] case class ::[T](hea...
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.