A typeclass giving the values of an enumeration
The companion object contains the machinery to automatically derive the values of a sealed trait extended by case objects only.
The companion object contains the machinery to automatically derive the values of a sealed trait extended by case objects only.
Basically, the derivation process is the following:
A
;List
;List
contains all the possible values of type A
.The first step is the hard part of this process and is actually achieved by shapeless (using macros).
A typeclass giving the values of an enumeration