| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.THGen.Enum
Description
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
Documentation
enumGenerate :: EnumDesc -> DecsQ Source #