registry-hedgehog-0.7.1.1: utilities to work with Hedgehog generators and `registry`
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Registry.Hedgehog.TH

Synopsis

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 

Fields

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 #