registry-hedgehog-0.7.0.0: utilities to work with Hedgehog generators and `registry`
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Registry.Hedgehog.TH

Synopsis

Documentation

makeGenerators :: 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 #