quickcheck-contractmodel-0.1.4.1
Safe HaskellNone
LanguageHaskell2010

Test.QuickCheck.ContractModel.Internal

Documentation

class (ContractModel state, IsRunnable m) => RunModel state m where Source #

Minimal complete definition

perform

Methods

perform :: ModelState state -> Action state -> (forall t. HasSymbolicRep t => Symbolic t -> t) -> RunMonad m () Source #

Perform an Action in some state in the Monad m. This is the function that's used to exercise the actual stateful implementation, usually through various side-effects as permitted by m. It produces a value of type a, eg. some observable output from the Action that should later be kept in the environment through a `Var a` also passed to the nextState function.

The Lookup parameter provides an environment to lookup `Var a` instances from previous steps.

monitoring :: (ModelState state, ModelState state) -> Action state -> (forall t. HasSymbolicRep t => Symbolic t -> t) -> SymIndex -> Property -> Property Source #

Allows the user to attach information to the Property at each step of the process. This function is given the full transition that's been executed, including the start and ending state, the Action, the current environment to Lookup and the value produced by perform while executing this step.

newtype RunMonad m a Source #

Constructors

RunMonad 

Fields

Instances

Instances details
MonadTrans RunMonad Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

Methods

lift :: Monad m => m a -> RunMonad m a

MonadError e m => MonadError e (RunMonad m) Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

Methods

throwError :: e -> RunMonad m a

catchError :: RunMonad m a -> (e -> RunMonad m a) -> RunMonad m a

MonadState s m => MonadState s (RunMonad m) Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

Methods

get :: RunMonad m s

put :: s -> RunMonad m ()

state :: (s -> (a, s)) -> RunMonad m a

Monad m => MonadWriter SymIndex (RunMonad m) Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

Methods

writer :: (a, SymIndex) -> RunMonad m a

tell :: SymIndex -> RunMonad m ()

listen :: RunMonad m a -> RunMonad m (a, SymIndex)

pass :: RunMonad m (a, SymIndex -> SymIndex) -> RunMonad m a

Monad m => Monad (RunMonad m) Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

Methods

(>>=) :: RunMonad m a -> (a -> RunMonad m b) -> RunMonad m b Source #

(>>) :: RunMonad m a -> RunMonad m b -> RunMonad m b Source #

return :: a -> RunMonad m a Source #

Functor m => Functor (RunMonad m) Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

Methods

fmap :: (a -> b) -> RunMonad m a -> RunMonad m b Source #

(<$) :: a -> RunMonad m b -> RunMonad m a Source #

Monad m => MonadFail (RunMonad m) Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

Methods

fail :: String -> RunMonad m a Source #

Applicative m => Applicative (RunMonad m) Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

Methods

pure :: a -> RunMonad m a Source #

(<*>) :: RunMonad m (a -> b) -> RunMonad m a -> RunMonad m b Source #

liftA2 :: (a -> b -> c) -> RunMonad m a -> RunMonad m b -> RunMonad m c Source #

(*>) :: RunMonad m a -> RunMonad m b -> RunMonad m b Source #

(<*) :: RunMonad m a -> RunMonad m b -> RunMonad m a Source #

(Monad m, HasChainIndex m) => HasChainIndex (RunMonad m) Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

IsRunnable m => IsRunnable (RunMonad m) Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

Methods

awaitSlot :: SlotNo -> RunMonad m () Source #

(IsRunnable m, RunModel state m) => RunModel (ModelState state) (RunMonad m) Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

Methods

perform :: Typeable a => ModelState state -> Action (ModelState state) a -> LookUp (RunMonad m) -> RunMonad m (Realized (RunMonad m) a)

postcondition :: (ModelState state, ModelState state) -> Action (ModelState state) a -> LookUp (RunMonad m) -> Realized (RunMonad m) a -> PostconditionM (RunMonad m) Bool

monitoring :: (ModelState state, ModelState state) -> Action (ModelState state) a -> LookUp (RunMonad m) -> Realized (RunMonad m) a -> Property -> Property

type Realized (RunMonad m) a Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

type Realized (RunMonad m) a = Realized m a

liftRunMonad :: (forall a. m a -> n a) -> RunMonad m a -> RunMonad n a Source #

registerToken :: Monad m => String -> AssetId -> RunMonad m () Source #

registerTxOut :: Monad m => String -> TxOut CtxUTxO Era -> RunMonad m () Source #

registerTxIn :: Monad m => String -> TxIn -> RunMonad m () Source #

type DefaultRealized m = (Realized m SymIndex ~ SymIndex, Realized m () ~ ()) Source #

class (DefaultRealized m, HasChainIndex m, Monad m) => IsRunnable m where Source #

Methods

awaitSlot :: SlotNo -> m () Source #

Instances

Instances details
IsRunnable m => IsRunnable (RunMonad m) Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

Methods

awaitSlot :: SlotNo -> RunMonad m () Source #

(DefaultRealized m, IsRunnable m) => IsRunnable (ReaderT r m) Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

Methods

awaitSlot :: SlotNo -> ReaderT r m () Source #

(DefaultRealized m, IsRunnable m) => IsRunnable (StateT s m) Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

Methods

awaitSlot :: SlotNo -> StateT s m () Source #

(Monoid w, DefaultRealized m, IsRunnable m) => IsRunnable (WriterT w m) Source # 
Instance details

Defined in Test.QuickCheck.ContractModel.Internal

Methods

awaitSlot :: SlotNo -> WriterT w m () Source #

runContractModel :: (ContractModel state, RunModel state m, HasChainIndex m) => Actions state -> PropertyM (RunMonad m) (ContractModelResult state) Source #

Orphan instances

(Monad m, HasChainIndex m) => HasChainIndex (PostconditionM m) Source # 
Instance details

Methods

getChainIndex :: PostconditionM m ChainIndex Source #

getChainState :: PostconditionM m ChainState Source #