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

PlutusCore.Generators.QuickCheck.Utils

Synopsis

Documentation

class Container f where #

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

Associated Types

data OneHoleContext f :: Type -> Type #

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

Methods

oneHoleContexts :: f a -> [(OneHoleContext f a, a)] #

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

plugHole :: OneHoleContext f a -> a -> f a #

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

Instances

Instances details
Container NonEmpty #

An analogous implementation of Container as for lists

Instance details

Defined in PlutusCore.Generators.QuickCheck.Utils

Associated Types

data OneHoleContext NonEmpty :: Type -> Type #

Container List #

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 List :: Type -> Type #

Methods

oneHoleContexts :: [a] -> [(OneHoleContext List a, a)] #

plugHole :: OneHoleContext List a -> a -> [a] #

uniqueVectorOf :: Eq a => Int -> Gen a -> Gen [a] #

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) => String -> Gen a -> (a -> [a]) -> (a -> p) -> Property #

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

ceDoc :: Testable t => PrettyReadable a, Testable p) => String -> a -> (a -> p) -> Property #

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

assertNoCounterexamples :: PrettyReadable a => [a] -> Property #

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

freshenTyNameWith :: DefaultUni ()) #

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