HORIZON HASKELLDocslts/ghc-10.0.xc62e4de2026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · c62e4de · 2026-10-19

Modulequickcheck-dynamic-4.0.1Haskell2010

Test.QuickCheck.DynamicLogic

Monadic interface for writing Dynamic Logic properties.

This interface offers a much nicer experience than manipulating the expressions it is implemented on top of, especially as it improves readability. It's still possible to express properties as pure expressions using the Test.QuickCheck.DynamicLogic.Internal module and it might make sense depending on the context and the kind of properties one wants to express.

  • 1 type
  • 1 class
  • 19 values
newtypenewtype DL s a
#

The DL monad provides a nicer interface to dynamic logic formulae than the plain API. It's a continuation monad producing a DynFormula formula, with a state component (with variable context) threaded through.

Instances5Monad, Functor, MonadFail, Applicative, Alternative
  • Monad (DL s)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic
  • Functor (DL s)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic
  • MonadFail (DL s)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic
  • Applicative (DL s)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic
  • Alternative (DL s)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic
valueassert :: String -> Bool -> DL s ()
#

Fail if the boolean is False.

Equivalent to

assert msg b = unless b (fail msg)
valueforAllQ :: Quantifiable q => q -> DL s (Quantifies q)
#

Generate a random value using the given Quantification (or list/tuple of quantifications). Generated values will only shrink to smaller values that could also have been generated.

classclass StateModel s => DynLogicModel s where
#

Restricted calls are not generated by AfterAny; they are included in tests explicitly using After in order to check specific properties at controlled times, so they are likely to fail if invoked at other times.

Methods