plutus-core-1.48.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusCore.Generators.Hedgehog.AST

Synopsis

Documentation

simpleRecursiveMonadGen m ⇒ [m a] → [m a] → m a Source #

regenConstantsUntilMonadGen m ⇒ (Some (ValueOf DefaultUni) → Bool) → Program tyname name DefaultUni fun ann → m (Program tyname name DefaultUni fun ann) Source #

Replace all constants in a program failing the given predicate with newly generated ones that are guaranteed to satisfy the predicate (if such constants cannot be generated, this generator will fail).

type AstGen = GenT (Reader [Name]) Source #

The monad that generators run in. The environment is a list of names to choose from for generation of variables and binders.

runAstGenMonadGen m ⇒ AstGen a → m a Source #

genNamesMonadGen m ⇒ m [Name] Source #

Generate a fixed set of names which we will use, of only up to a short size to make it likely that we get reuse. We do not attempt not to generate reserved words such as all or abs as the classic syntax parsers (both PLC and PIR ones) can handle names of variables clashing with reserved words. In the readable syntax that would be troubling, though, but we don't have a parser for that anyway.

genBuiltin ∷ (MonadGen m, Bounded fun, Enum fun) ⇒ m fun Source #

genTerm ∷ ∀ fun. (Bounded fun, Enum fun) ⇒ AstGen (Term TyName Name DefaultUni fun ()) Source #

genProgram ∷ ∀ fun. (Bounded fun, Enum fun) ⇒ AstGen (Program TyName Name DefaultUni fun ()) Source #