quickcheck-dynamic-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Test.QuickCheck.DynamicLogic.Monad

Synopsis

Documentation

data DL s a Source #

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

Instances

Instances details
Monad (DL s) Source # 
Instance details

Defined in Test.QuickCheck.DynamicLogic.Monad

Methods

(>>=) :: DL s a -> (a -> DL s b) -> DL s b Source #

(>>) :: DL s a -> DL s b -> DL s b Source #

return :: a -> DL s a Source #

Functor (DL s) Source # 
Instance details

Defined in Test.QuickCheck.DynamicLogic.Monad

Methods

fmap :: (a -> b) -> DL s a -> DL s b Source #

(<$) :: a -> DL s b -> DL s a Source #

MonadFail (DL s) Source # 
Instance details

Defined in Test.QuickCheck.DynamicLogic.Monad

Methods

fail :: String -> DL s a Source #

Applicative (DL s) Source # 
Instance details

Defined in Test.QuickCheck.DynamicLogic.Monad

Methods

pure :: a -> DL s a Source #

(<*>) :: DL s (a -> b) -> DL s a -> DL s b Source #

liftA2 :: (a -> b -> c) -> DL s a -> DL s b -> DL s c Source #

(*>) :: DL s a -> DL s b -> DL s b Source #

(<*) :: DL s a -> DL s b -> DL s a Source #

Alternative (DL s) Source # 
Instance details

Defined in Test.QuickCheck.DynamicLogic.Monad

Methods

empty :: DL s a Source #

(<|>) :: DL s a -> DL s a -> DL s a Source #

some :: DL s a -> DL s [a] Source #

many :: DL s a -> DL s [a] Source #

action :: (Show a, Typeable a, Eq (Action s a)) => Action s a -> DL s () Source #

anyActions :: Int -> DL s () Source #

weight :: Double -> DL s () Source #

assert :: String -> Bool -> DL s () Source #

Fail if the boolean is False.

Equivalent to

assert msg b = unless b (fail msg)

assertModel :: String -> (s -> Bool) -> DL s () Source #

forAllQ :: Quantifiable q => q -> DL s (Quantifies q) Source #

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.

forAllDL :: (DynLogicModel s, Testable a) => DL s () -> (Actions s -> a) -> Property Source #

forAllDL_ :: (DynLogicModel s, Testable a) => DL s () -> (Actions s -> a) -> Property Source #

forAllMappedDL :: (DynLogicModel s, Testable a, Show rep) => (rep -> DynLogicTest s) -> (DynLogicTest s -> rep) -> (Actions s -> srep) -> DL s () -> (srep -> a) -> Property Source #

forAllMappedDL_ :: (DynLogicModel s, Testable a, Show rep) => (rep -> DynLogicTest s) -> (DynLogicTest s -> rep) -> (Actions s -> srep) -> DL s () -> (srep -> a) -> Property Source #

forAllUniqueDL :: (DynLogicModel s, Testable a) => Int -> s -> DL s () -> (Actions s -> a) -> Property Source #

withDLTest :: (DynLogicModel s, Testable a) => DL s () -> (Actions s -> a) -> DynLogicTest s -> Property Source #

data DynLogic s Source #

Dynamic logic formulae.

class StateModel s => DynLogicModel s where Source #

Minimal complete definition

Nothing

Methods

restricted :: Action s a -> Bool Source #

data DynLogicTest s Source #

Constructors

BadPrecondition [TestStep s] [Any (Action s)] s 
Looping [TestStep s] 
Stuck [TestStep s] s 
DLScript [TestStep s] 

Instances

Instances details
StateModel s => Show (DynLogicTest s) Source # 
Instance details

Defined in Test.QuickCheck.DynamicLogic

data TestStep s Source #

Constructors

Do (Step s) 
forall a.(Eq a, Show a, Typeable a) => Witness a 

Instances

Instances details
Eq (TestStep s) Source # 
Instance details

Defined in Test.QuickCheck.DynamicLogic

Methods

(==) :: TestStep s -> TestStep s -> Bool Source #

(/=) :: TestStep s -> TestStep s -> Bool Source #

StateModel s => Show (TestStep s) Source # 
Instance details

Defined in Test.QuickCheck.DynamicLogic