| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusCore.Generators.QuickCheck.Utils
Synopsis
- class Container f where
- data OneHoleContext f :: DefaultUni ())
- module PlutusCore.Generators.QuickCheck.Split
Documentation
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
| Container NonEmpty # | An analogous implementation of |
Defined in PlutusCore.Generators.QuickCheck.Utils Associated Types data OneHoleContext NonEmpty :: Type -> Type # Methods oneHoleContexts :: NonEmpty a -> [(OneHoleContext NonEmpty a, a)] # plugHole :: OneHoleContext NonEmpty a -> a -> NonEmpty a # | |
| Container List # | Containers for lists is zipper like, a hole is a specific position in the list |
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.