如何在scalaz中进行以下类比?
ghci> data Day = Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday deriving (Eq, Show, Enum)
ghci> [Monday .. Wednesday]
[Monday,Tuesday,Wednesday]
例如,一旦定义了Enum实例,我应该能够(Monday |-> Wednesday)
并获得List(Monday,Tuesday,Wednesday)
。
AnyVal.scala中的枚举实例似乎相当复杂。有更简单的方法吗?