All the cool kids have their own Enumeration implementation, most of which try to do so in the name of implementing exhaustive pattern matching.
This is yet another one.
Oh yeah, Enum is BYOO (bring your own ordinality). Take care of that when you implement the value method.
How to use:
sealed trait DummyEnum object DummyEnum extends Enum[DummyEnum] { val values = findValues.toIndexedSeq case object Hello extends DummyEnum case object GoodBye extends DummyEnum case object Hi extends DummyEnum } DummyEnum.values should be(Set(Hello, GoodBye, Hi)) DummyEnum.withName("Hello") should be(Hello)
The sealed trait you want to use as the main
All the cool kids have their own Enumeration implementation, most of which try to do so in the name of implementing exhaustive pattern matching.
This is yet another one.
Oh yeah, Enum is BYOO (bring your own ordinality). Take care of that when you implement the value method.
How to use:
The sealed trait you want to use as the main