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

PlutusCore.Generators.QuickCheck.Utils

Synopsis

Documentation

class Container f where Source #

A type is a container for the purposes of shrinking if it has:

Associated Types

data OneHoleContext f ∷ TypeType Source #

One hole context where we can shrink a single "element" of the container

Methods

oneHoleContexts ∷ f a → [(OneHoleContext f a, a)] Source #

A way of getting all the one hole contexts of an `f a`

plugHoleOneHoleContext f a → a → f a Source #

A way to plug the hole with a new, shrunk, term

Instances

Instances details
Container NonEmpty Source #

An analogous implementation of Container as for lists

Instance details

Defined in PlutusCore.Generators.QuickCheck.Utils

Associated Types

data OneHoleContext NonEmptyTypeType Source #

Container List Source #

Containers for lists is zipper like, a hole is a specific position in the list

Instance details

Defined in PlutusCore.Generators.QuickCheck.Utils

Associated Types

data OneHoleContext ListTypeType Source #

Methods

oneHoleContexts ∷ [a] → [(OneHoleContext List a, a)] Source #

plugHoleOneHoleContext List a → a → [a] Source #

uniqueVectorOfEq a ⇒ IntGen a → Gen [a] Source #

Generate a list of the given length, all arguments of which are distinct. Takes O(n^2) time or more if the generator is likely to generate equal values.

forAllDoc ∷ (PrettyReadable a, Testable p) ⇒ StringGen a → (a → [a]) → (a → p) → Property Source #

Like forAllShrink but displays the bound value as a named pretty-printed binding like letCE

ceDocTestable t ⇒ Doc ann → t → Property Source #

Show a Doc when a property fails.

letCE ∷ (PrettyReadable a, Testable p) ⇒ String → a → (a → p) → Property Source #

Bind a value to a name in a property so that it is displayed as a `name = thing` binding if the property fails.

assertNoCounterexamplesPrettyReadable a ⇒ [a] → Property Source #

Check that a list of potential counterexamples is empty and display the list as a QuickCheck counterexample if its not.

freshenTyNameWithSet TyNameTyNameTyName Source #

Freshen a TyName so that it does not equal any of the names in the set.

constrTypesDatatype TyName Name DefaultUni () → [(Name, Type TyName DefaultUni ())] Source #

Get the names and types of the constructors of a datatype.

matchTypeDatatype TyName Name DefaultUni () → (Name, Type TyName DefaultUni ()) Source #

Get the name and type of the match function for a given datatype.