registry-hedgehog- utilities to work with Hedgehog generators and `registry`

Safe HaskellNone




makeSelectGenerator :: Name -> [Con] -> ExpQ Source #

Create a generator for selecting between constructors of an ADT One parameter is a GenIO Chooser in order to be able to later on switch the selection strategy

untagGenerator :: Con -> ExpQ Source #

Remove the tag of a given constructor: fmap unTag g :: GenIO (Tag "t" SomeType) -> GenIO SomeType

tagName :: Con -> Q Name Source #

Create a tag used to distinguish constructors in an ADT

constructorParameterName :: Con -> Q Name Source #

Same as the tag name but lower cased

constructorName :: Con -> Q Text Source #

Extract the last name of a constructor

nameOf :: Con -> Q Name Source #

The name of a given constructor

typesOf :: Con -> Q [Type] Source #

The list of types necessary to create a given constructor

assembleGeneratorsToRegistry :: Exp -> [Exp] -> ExpQ Source #

runQ [| fun g <: genFun e <: genFun f|] InfixE (Just (AppE (VarE (UnboundVarE g))) (VarE <:) (Just (InfixE (Just (AppE (VarE Data.Registry.Hedgehog.genFun) (UnboundVarE e))) (VarE Data.Registry.Registry.<:) (Just (AppE (VarE Data.Registry.Hedgehog.genFun) (UnboundVarE f)))))