Safe Haskell | None |
---|---|
Language | Haskell2010 |
Generate enumeration data types with prefixed constructors but unprefixed
Show
and Read
instances.
enumGenerate $ EnumDesc "Animal" ["Cat", "Dog", "Gopher"]
produces
data Animal = AnimalCat | AnimalDog | AnimalGopher
yet Read
and Show
parse and print regular values:
show AnimalDog == "Dog" (read "Cat" :: Animal) == AnimalCat