quickcheck-dynamic-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Test.QuickCheck.StateModel

Documentation

class (forall a. Show (Action state a), Monad (ActionMonad state), Show state, Typeable state) => StateModel state where Source #

Minimal complete definition

arbitraryAction, initialState

Associated Types

data Action state a Source #

type ActionMonad state :: * -> * Source #

Methods

actionName :: Action state a -> String Source #

arbitraryAction :: state -> Gen (Any (Action state)) Source #

shrinkAction :: (Typeable a, Show a) => state -> Action state a -> [Any (Action state)] Source #

initialState :: state Source #

nextState :: state -> Action state a -> Var a -> state Source #

precondition :: state -> Action state a -> Bool Source #

perform :: state -> Action state a -> LookUp -> ActionMonad state a Source #

postcondition :: state -> Action state a -> LookUp -> a -> Bool Source #

monitoring :: (state, state) -> Action state a -> LookUp -> a -> Property -> Property Source #

data Any f where Source #

Constructors

Some :: (Show a, Typeable a, Eq (f a)) => f a -> Any f 
Error :: String -> Any f 

Instances

Instances details
Eq (Any f) Source # 
Instance details

Defined in Test.QuickCheck.StateModel

Methods

(==) :: Any f -> Any f -> Bool Source #

(/=) :: Any f -> Any f -> Bool Source #

(forall a. Show (Action state a)) => Show (Any (Action state)) Source # 
Instance details

Defined in Test.QuickCheck.StateModel

Methods

showsPrec :: Int -> Any (Action state) -> ShowS Source #

show :: Any (Action state) -> String Source #

showList :: [Any (Action state)] -> ShowS Source #

data Step state where Source #

Constructors

(:=) :: (Show a, Typeable a, Eq (Action state a), Typeable (Action state a), Show (Action state a)) => Var a -> Action state a -> Step state infix 5 

Instances

Instances details
Eq (Step state) Source # 
Instance details

Defined in Test.QuickCheck.StateModel

Methods

(==) :: Step state -> Step state -> Bool Source #

(/=) :: Step state -> Step state -> Bool Source #

(forall a. Show (Action state a)) => Show (Step state) Source # 
Instance details

Defined in Test.QuickCheck.StateModel

Methods

showsPrec :: Int -> Step state -> ShowS Source #

show :: Step state -> String Source #

showList :: [Step state] -> ShowS Source #

type LookUp = forall a. Typeable a => Var a -> a Source #

newtype Var a Source #

Constructors

Var Int 

Instances

Instances details
Eq (Var a) Source # 
Instance details

Defined in Test.QuickCheck.StateModel

Methods

(==) :: Var a -> Var a -> Bool Source #

(/=) :: Var a -> Var a -> Bool Source #

Data a => Data (Var a) Source # 
Instance details

Defined in Test.QuickCheck.StateModel

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Var a -> c (Var a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Var a) Source #

toConstr :: Var a -> Constr Source #

dataTypeOf :: Var a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Var a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Var a)) Source #

gmapT :: (forall b. Data b => b -> b) -> Var a -> Var a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Var a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Var a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Var a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Var a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Var a -> m (Var a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Var a -> m (Var a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Var a -> m (Var a) Source #

Ord (Var a) Source # 
Instance details

Defined in Test.QuickCheck.StateModel

Methods

compare :: Var a -> Var a -> Ordering Source #

(<) :: Var a -> Var a -> Bool Source #

(<=) :: Var a -> Var a -> Bool Source #

(>) :: Var a -> Var a -> Bool Source #

(>=) :: Var a -> Var a -> Bool Source #

max :: Var a -> Var a -> Var a Source #

min :: Var a -> Var a -> Var a Source #

Show (Var a) Source # 
Instance details

Defined in Test.QuickCheck.StateModel

Methods

showsPrec :: Int -> Var a -> ShowS Source #

show :: Var a -> String Source #

showList :: [Var a] -> ShowS Source #

data Actions state Source #

Constructors

Actions_ [String] (Smart [Step state]) 

Instances

Instances details
Eq (Actions state) Source # 
Instance details

Defined in Test.QuickCheck.StateModel

Methods

(==) :: Actions state -> Actions state -> Bool Source #

(/=) :: Actions state -> Actions state -> Bool Source #

(forall a. Show (Action state a)) => Show (Actions state) Source # 
Instance details

Defined in Test.QuickCheck.StateModel

Methods

showsPrec :: Int -> Actions state -> ShowS Source #

show :: Actions state -> String Source #

showList :: [Actions state] -> ShowS Source #

Semigroup (Actions state) Source # 
Instance details

Defined in Test.QuickCheck.StateModel

Methods

(<>) :: Actions state -> Actions state -> Actions state Source #

sconcat :: NonEmpty (Actions state) -> Actions state Source #

stimes :: Integral b => b -> Actions state -> Actions state Source #

(Typeable state, StateModel state) => Arbitrary (Actions state) Source # 
Instance details

Defined in Test.QuickCheck.StateModel

Methods

arbitrary :: Gen (Actions state) Source #

shrink :: Actions state -> [Actions state] Source #

pattern Actions :: [Step state] -> Actions state Source #

data EnvEntry where Source #

Constructors

(:==) :: (Show a, Typeable a) => Var a -> a -> EnvEntry infix 5 

Instances

Instances details
Show EnvEntry Source # 
Instance details

Defined in Test.QuickCheck.StateModel

type Env = [EnvEntry] Source #

stateAfter :: StateModel state => Actions state -> state Source #

runActions :: StateModel state => Actions state -> PropertyM (ActionMonad state) (state, Env) Source #

runActionsInState :: StateModel state => state -> Actions state -> PropertyM (ActionMonad state) (state, Env) Source #

lookUpVar :: Typeable a => Env -> Var a -> a Source #