Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- makeGenerators :: Name -> ExpQ
- emptyRegistry :: Registry '[] '[]
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 #