直積型直和型 の組み合わせ

ScalaだとEnumとCase Classを組み合わせて表現できる

enum YearsActive {
  case StillActive(since: Int)
  case ActiveBetween(start: Int, end: Int)
}