3 ms·
Use Scala -- first class support for objects and ADTs.
by YorkshireSeason 8y ago
Use Scala -- first class support for objects and ADTs.
- mcintyre1994 8y agoBut not for that syntax unfortunately, unless I'm missing it? I use sealed traits and case classes to do the same - the union syntax would be much nicer.
- virtualwhys 8y agoComing in Dotty/Scala 3.0, along with a slew of other improvements to the language. Combine that with the proposed new enum syntax and existing sealed trait plus case class/object boilerplate will be gone. Looks pretty great, but we'll have to wait until next year sometime to use it in production.