Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Constrained.Conformance
Contents
Synopsis
- checkPred ∷ ∀ m. MonadGenError m ⇒ Env → Pred → m Bool
- checkPreds ∷ (MonadGenError m, Traversable t) ⇒ Env → t Pred → m Bool
- checkPredPure ∷ Env → Pred → Bool
- checkPredsE ∷ NonEmpty String → Env → [Pred] → Maybe (NonEmpty String)
- checkPredE ∷ Env → NonEmpty String → Pred → Maybe (NonEmpty String)
- conformsToSpecE ∷ ∀ a. HasSpec a ⇒ a → Specification a → NonEmpty String → Maybe (NonEmpty String)
- conformsToSpec ∷ HasSpec a ⇒ a → Specification a → Bool
- satisfies ∷ ∀ a. HasSpec a ⇒ Term a → Specification a → Pred
- monitorSpec ∷ Testable p ⇒ Specification a → a → p → Property
- monitorPred ∷ ∀ m. MonadGenError m ⇒ Env → Pred → m (Property → Property)
Documentation
checkPred ∷ ∀ m. MonadGenError m ⇒ Env → Pred → 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 #
checkPredPure ∷ Env → Pred → Bool Source #
checkPredsE ∷ NonEmpty 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
checkPredE ∷ Env → NonEmpty 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).
conformsToSpec ∷ HasSpec a ⇒ a → Specification a → Bool Source #
monitorSpec ∷ Testable 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 ⇒ Env → Pred → m (Property → Property) Source #
Orphan instances
HasSpec a ⇒ Monoid (Specification a) Source # | |
Methods mempty ∷ Specification a mappend ∷ Specification a → Specification a → Specification a mconcat ∷ [Specification a] → Specification a | |
HasSpec a ⇒ Semigroup (Specification a) Source # | |
Methods (<>) ∷ Specification a → Specification a → Specification a # sconcat ∷ NonEmpty (Specification a) → Specification a stimes ∷ Integral b ⇒ b → Specification a → Specification a |