Oℕ
Size: a a a
Oℕ
Oℕ
𝛈µ
Oℕ
𝛈µ
Oℕ
𝛈µ
𝛈µ
𝛈µ
LR
NP
LR
VS
import enumeratum._
sealed abstract class Greeting[T](bar: T => T) extends EnumEntry
object Greeting extends Enum[Greeting[???]] {
val values = findValues
case object Hello extends Greeting[String](identity)
case object GoodBye extends Greeting[Int](identity)
}
Greeting.withName("Hello").bar("foo")
Oℕ
Oℕ
VS
Oℕ
VS
Oℕ
sealed trait Greeting extends EnumEntry with Product with Serializable {
type T
def bar: T => T
}
object Greeting extends Enum[Greeting] {
val values = findValues
abstract class Item[I](val bar: I => I) extends Greeting { type T = I }
case object Hello extends Item[String](identity)
case object Goodbye extends Item[Int](identity)
}
Oℕ
Greeting.withName("Hello").bar("foo")