xml-isogen-0.3.0: Generate XML-isomorphic types

Safe HaskellNone
LanguageHaskell2010

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