Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- makeSelectGenerator :: Name -> [Con] -> ExpQ
- makeConstructorGenerator :: Con -> ExpQ
- untagGenerator :: Con -> ExpQ
- tagName :: Con -> Q Name
- constructorParameterName :: Con -> Q Name
- constructorName :: Con -> Q Text
- nameOf :: Con -> Q Name
- typesOf :: Con -> Q [Type]
- assembleGeneratorsToRegistry :: Exp -> [Exp] -> ExpQ
- app :: ExpQ -> ExpQ -> ExpQ
- genFunOf :: ExpQ -> ExpQ
- funOf :: ExpQ -> ExpQ
Documentation
makeSelectGenerator :: Name -> [Con] -> ExpQ Source #
Create a generator for selecting between constructors of an ADT One parameter is a Gen Chooser in order to be able to later on switch the selection strategy
makeConstructorGenerator :: Con -> ExpQ Source #
untagGenerator :: Con -> ExpQ Source #
Remove the tag of a given constructor: fmap unTag g :: Gen (Tag "t" SomeType) -> Gen SomeType
assembleGeneratorsToRegistry :: Exp -> [Exp] -> ExpQ Source #
runQ [| fun g +: genFun e +: genFun f|] InfixE (Just (AppE (VarE Data.Registry.Registry.fun) (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)))))