| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Data.Registry.Hedgehog.TH
Synopsis
- newtype GeneratorOptions = GeneratorOptions {}
- makeGenerators :: Name -> ExpQ
- makeGeneratorsUnchecked :: Name -> ExpQ
- makeGeneratorsWith :: GeneratorOptions -> Name -> ExpQ
- emptyRegistry :: Registry '[] '[]
Documentation
newtype GeneratorOptions Source #
Options for changing the generated TH code if checked = True then we use the <: operator which checks input otherwise we use the <+ operator which doesn't check inputs
Constructors
| GeneratorOptions | |
Instances
| Show GeneratorOptions Source # | |
Defined in Data.Registry.Internal.TH Methods showsPrec :: Int -> GeneratorOptions -> ShowS # show :: GeneratorOptions -> String # showList :: [GeneratorOptions] -> ShowS # | |
| Eq GeneratorOptions Source # | |
Defined in Data.Registry.Internal.TH Methods (==) :: GeneratorOptions -> GeneratorOptions -> Bool # (/=) :: GeneratorOptions -> GeneratorOptions -> Bool # | |
makeGenerators :: Name -> ExpQ Source #
makeGeneratorsUnchecked :: Name -> ExpQ Source #
makeGeneratorsWith :: GeneratorOptions -> Name -> ExpQ Source #
Make a registry containing generators for an ADT We want to generate the following
fun genEmployeeStatus
<: genFun (tag "permanent" Permanent)
<: genFun (tag "temporary" Temporary)
genEmployeeStatus :: Gen Chooser -> Gen (Tag "permanent" EmployeeStatus) -> Gen (Tag "temporary" EmployeeStatus) -> Gen EmployeeStatus genEmployeeStatus chooser g1 g2 = chooseOne chooser [fmap unTag1, fmap unTag g2]
emptyRegistry :: Registry '[] '[] Source #