Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class Container f where
- data OneHoleContext f ∷ Type → Type
- oneHoleContexts ∷ f a → [(OneHoleContext f a, a)]
- plugHole ∷ OneHoleContext f a → a → f a
- uniqueVectorOf ∷ Eq a ⇒ Int → Gen a → Gen [a]
- forAllDoc ∷ (PrettyReadable a, Testable p) ⇒ String → Gen a → (a → [a]) → (a → p) → Property
- ceDoc ∷ Testable t ⇒ Doc ann → t → Property
- letCE ∷ (PrettyReadable a, Testable p) ⇒ String → a → (a → p) → Property
- assertNoCounterexamples ∷ PrettyReadable a ⇒ [a] → Property
- freshenTyNameWith ∷ Set TyName → TyName → TyName
- maxUsedUnique ∷ Set TyName → Unique
- constrTypes ∷ Datatype TyName Name DefaultUni () → [(Name, Type TyName DefaultUni ())]
- matchType ∷ Datatype TyName Name DefaultUni () → (Name, Type TyName DefaultUni ())
- module PlutusCore.Generators.QuickCheck.Split
Documentation
class Container f where Source #
A type is a container for the purposes of shrinking if it has:
data OneHoleContext f ∷ Type → Type Source #
One hole context where we can shrink a single "element" of the container
oneHoleContexts ∷ f a → [(OneHoleContext f a, a)] Source #
A way of getting all the one hole contexts of an `f a`
plugHole ∷ OneHoleContext f a → a → f a Source #
A way to plug the hole with a new, shrunk, term
Instances
Container NonEmpty Source # | An analogous implementation of |
Defined in PlutusCore.Generators.QuickCheck.Utils oneHoleContexts ∷ NonEmpty a → [(OneHoleContext NonEmpty a, a)] Source # plugHole ∷ OneHoleContext NonEmpty a → a → NonEmpty a Source # | |
Container List Source # | Containers for lists is zipper like, a hole is a specific position in the list |
Defined in PlutusCore.Generators.QuickCheck.Utils oneHoleContexts ∷ [a] → [(OneHoleContext List a, a)] Source # plugHole ∷ OneHoleContext List a → a → [a] Source # |
uniqueVectorOf ∷ Eq a ⇒ Int → Gen 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) ⇒ String → Gen a → (a → [a]) → (a → p) → Property Source #
Like forAllShrink
but displays the bound value as
a named pretty-printed binding like letCE
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.
assertNoCounterexamples ∷ PrettyReadable a ⇒ [a] → Property Source #
Check that a list of potential counterexamples is empty and display the list as a QuickCheck counterexample if its not.
freshenTyNameWith ∷ Set TyName → TyName → TyName Source #
Freshen a TyName so that it does not equal any of the names in the set.
constrTypes ∷ Datatype TyName Name DefaultUni () → [(Name, Type TyName DefaultUni ())] Source #
Get the names and types of the constructors of a datatype.