| 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
data Exhaustiveness #
Constructors
| Exhaustive | |
| NonExhaustive |
Instances
| Eq Exhaustiveness # | |
Defined in Data.THGen.Enum Methods (==) :: Exhaustiveness -> Exhaustiveness -> Bool # (/=) :: Exhaustiveness -> Exhaustiveness -> Bool # | |
| Ord Exhaustiveness # | |
Defined in Data.THGen.Enum Methods compare :: Exhaustiveness -> Exhaustiveness -> Ordering # (<) :: Exhaustiveness -> Exhaustiveness -> Bool # (<=) :: Exhaustiveness -> Exhaustiveness -> Bool # (>) :: Exhaustiveness -> Exhaustiveness -> Bool # (>=) :: Exhaustiveness -> Exhaustiveness -> Bool # max :: Exhaustiveness -> Exhaustiveness -> Exhaustiveness # min :: Exhaustiveness -> Exhaustiveness -> Exhaustiveness # | |
| Show Exhaustiveness # | |
Defined in Data.THGen.Enum Methods showsPrec :: Int -> Exhaustiveness -> ShowS # show :: Exhaustiveness -> String # showList :: [Exhaustiveness] -> ShowS # | |
enumGenerate :: EnumDesc -> DecsQ #