HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduletasty-smallcheck-0.8.2Haskell2010

Test.Tasty.SmallCheck

This module allows to use SmallCheck properties in tasty.

  • 4 types
  • 1 class
  • 9 values
newtypenewtype SmallCheckDepth
#

The "depth" parameter for SmallCheck

Constructors

Instances7Enum, Eq, Integral, Num, Ord, Real, …
value(==>) :: (Testable m c, Testable m a) => c -> a -> Property m
#

The ==> operator can be used to express a restricting condition under which a property should hold. It corresponds to implication in the classical logic.

Note that ==> resets the quantification context for its operands to the default (universal).

newtypenewtype Property (m :: Type -> Type)
#

The type of properties over the monad m.

Instances2Testable, IsTest
classclass Monad m => Testable (m :: Type -> Type) a where
#

Class of tests that can be run in a monad. For pure tests, it is recommended to keep their types polymorphic in m rather than specialising it to Data.Functor.Identity.

Methods

Instances4Testable
valueexistsUnique :: Testable m a => a -> Property m
#

Set the uniqueness quantification context.

Bear in mind that \exists! x, y\colon p\, x \, y is not the same as \exists! x \colon \exists! y \colon p \, x \, y .

For example, \exists! x \colon \exists! y \colon |x| = |y| is true (it holds only when x=y=0), but \exists! x, y \colon |x| = |y| is false (there are many such pairs).

As is customary in mathematics, existsUnique $ \x y -> p x y is equivalent to existsUnique $ \(x, y) -> p x y and not to existsUnique $ \x -> existsUnique $ \y -> p x y (the latter, of course, may be explicitly written when desired).

That is, all the variables affected by the same uniqueness context are quantified simultaneously as a tuple.

valueover :: (Show a, Testable m b) => Series m a -> (a -> b) -> Property m
#

over s $ \x -> p x makes x range over the Series s (by default, all variables range over the series for their types).

Note that, unlike the quantification operators, this affects only the variable following the operator and not subsequent variables.

over does not affect the quantification context.

typetype Reason = String
#

An explanation for the test outcome.

typetype Depth = Int
#

Maximum depth of generated test values.

For data values, it is the depth of nested constructor applications.

For functional values, it is both the depth of nested case analysis and the depth of results.

Orphan instances

1 instance