Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
WOE
is an acronym for "Write-Once Enum". This package provides the IsoEnum
class to allow for more convenient declaration of arbitrary-index enums. This removes the need for writing boilerplate 'toEnum'/'fromEnum' definitions if you were to implement Enum
directly. To expose an Enum
interface for your custom enum type (which we'll call X
), simply do 'deriving Enum via WOE'. This requires the DerivingVia
extension provided by more GHC 8.6.1+.