Hacker News new | past | comments | ask | show | jobs | submit login

Enums are awful in Scala. I usually just use this pattern:

    abstract case class MyEnum(id: Int)
    object MyEnum {
      object Foo extends MyEnum(0)
      object Bar extends MyEnum(1)
      object Baz extends MyEnum(2)
    }



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: