constrained-generators-0.2.0.0: Framework for generating constrained random data using a subset of first order logic
Safe HaskellSafe-Inferred
LanguageHaskell2010

Constrained.Conformance

Synopsis

Documentation

checkPred ∷ ∀ m. MonadGenError m ⇒ EnvPred → m Bool Source #

Does the Pred evaluate to true under the given Env. If it doesn't, some explanation appears in the failure of the monad m

checkPreds ∷ (MonadGenError m, Traversable t) ⇒ Env → t Pred → m Bool Source #

checkPredPureEnvPred → Bool Source #

checkPredsENonEmpty String → Env → [Pred] → Maybe (NonEmpty String) Source #

Like checkPred, But it takes [Pred] rather than a single Pred, and it builds a much more involved explanation if it fails. Does the Pred evaluate to True under the given Env? If it doesn't, an involved explanation appears in the (Just message) If it does, then it returns Nothing

checkPredEEnvNonEmpty String → Pred → Maybe (NonEmpty String) Source #

An involved explanation for a single Pred The most important explanations come when an assertion fails.

conformsToSpecE ∷ ∀ a. HasSpec a ⇒ a → Specification a → NonEmpty String → Maybe (NonEmpty String) Source #

conformsToSpec with explanation. Nothing if (conformsToSpec a spec), but (Just explanations) if not(conformsToSpec a spec).

conformsToSpecHasSpec a ⇒ a → Specification a → Bool Source #

satisfies ∷ ∀ a. HasSpec a ⇒ Term a → Specification a → Pred Source #

monitorSpecTestable p ⇒ Specification a → a → p → Property Source #

Collect the monitor calls from a specification instantiated to the given value. Typically,

>>> quickCheck $ forAll (genFromSpec spec) $ \ x -> monitorSpec spec x $ ...

monitorPred ∷ ∀ m. MonadGenError m ⇒ EnvPred → m (PropertyProperty) Source #

Orphan instances

HasSpec a ⇒ Monoid (Specification a) Source # 
Instance details

HasSpec a ⇒ Semigroup (Specification a) Source # 
Instance details

Methods

(<>)Specification a → Specification a → Specification a #

sconcatNonEmpty (Specification a) → Specification a

stimes ∷ Integral b ⇒ b → Specification a → Specification a