Specifically using the new enum
keyword provided by Scala 3...
enum Translation(val bit: Byte):
case FlipX extends Translation(1)
case FlipY extends Translation(2)
case RotateClockwise extends Translation(4) //90 degrees
...What are the Scala 3 idiomatic style options to achieve the equivalent of Java's java.util.EnumSet
and java.util.EnumMap
?
I'm explicitly excluding any Scala 2 style approaches, including Enumeratum (performance consideration).
EnumSet
andEnumMap
? What's wrong with a regularSet
orMap
? – ShannonshannyBitSet
andIntMap
– Dishcloth