underscoreio/essential-scala

Consider whether algebraic data types should use sealed abstract classes

Opened this issue · 0 comments

There are several benefits to using a sealed abstract class as the base of an algebraic data type:

  • it is faster
  • Java interop is cleaner
  • it is semantically clearer (an abstract class can't be mixed into multiple classes)

The disadvantage is we have to introduce another concept (abstract classes).

This will require quite a bit of rewriting.