Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- makeSelectGenerator :: Name -> [Con] -> ExpQ
- makeConstructorGenerator :: Con -> ExpQ
- untagGenerator :: Con -> ExpQ
- tagName :: Con -> Q Name
- nameOf :: Con -> Q Name
- typesOf :: Con -> Q [Type]
- assembleGeneratorsToRegistry :: Exp -> [Exp] -> ExpQ
- appendExpressions :: 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 GenIO 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 :: GenIO (Tag "t" SomeType) -> GenIO 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)))))