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

PlutusCore.Generators.Hedgehog.Entity

Description

Generators of various PLC things: Term uni fun) a -> GenT (ReaderT (BuiltinGensT uni fun m) m) #

The type used in generators defined in this module. It's parameterized by a BuiltinGensT which makes it possible to supply different generators of built-in types. For example, genTypedBuiltinDiv never generates a zero, so this generator can be used in order to avoid the divide-by-zero-induced error. Supplied generators are of arbitrary complexity and can call the currently running generator recursively, for example.

data IterApp head arg #

A function (called "head") applied to a list of arguments (called "spine").

Constructors

IterApp 

Fields

Instances

Instances details
(Term uni fun) res) #

Generate an IterAppValue from a Denotation. If the Denotation has a functional type, then all arguments are generated and supplied to the denotation. Since IterAppValue consists of three components, we 1. grow the Apply 2. grow the IterApp component by appending arguments to its spine 3. feed arguments to the Haskell function

genTerm #

Arguments

:: forall uni fun m. (uni Term uni fun)

A context to generate terms in. See for example typedBuiltins. Gets extended by a variable when an applied lambda is generated.

-> Term of the specified type and the corresponding Haskell value. Generates first-order functions and constants including constant applications. Arguments to functions and Term with rather small values to make out-of-bounds failures less likely. There are still like a half of terms that fail with out-of-bounds errors being evaluated.

withAnyTermLoose :: (uni Term uni fun) a -> GenT m c #

Generate a TypedBuiltin and a TermOf of the corresponding type, attach the TypedBuiltin to the value part of the TermOf and pass that to a continuation.