quickcheck-state-machine-0.7.0: Test monadic programs using state machine based models

Copyright(C) 2019 Edsko de Vries
LicenseBSD-style (see the file LICENSE)
MaintainerStevan Andjelkovic <stevan.andjelkovic@strath.ac.uk>
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Test.StateMachine.Labelling

Description

This module exports helpers that are useful for labelling properties.

Synopsis

Documentation

data Predicate a b Source #

Constructors

Predicate 

Fields

  • predApply :: a -> Either b (Predicate a b)

    Given an a, either successfully classify as b or continue looking

  • predFinish :: Maybe b

    End of the string

    The predicate is given a final chance to return a value.

Instances
Functor (Predicate a) Source # 
Instance details

Defined in Test.StateMachine.Labelling

Methods

fmap :: (a0 -> b) -> Predicate a a0 -> Predicate a b #

(<$) :: a0 -> Predicate a b -> Predicate a a0 #

predicate :: (a -> Either b (Predicate a b)) -> Predicate a b Source #

Construct simply predicate that returns Nothing on termination

maximum :: forall a b. Ord b => (a -> Maybe b) -> Predicate a b Source #

Maximum value found, if any

classify :: forall a b. [Predicate a b] -> [a] -> [b] Source #

Do a linear scan over the list, returning all successful classifications

data Event model cmd resp (r :: Type -> Type) Source #

Constructors

Event 

Fields

Instances
(Show (model r), Show (cmd r), Show (resp r)) => Show (Event model cmd resp r) Source # 
Instance details

Defined in Test.StateMachine.Labelling

Methods

showsPrec :: Int -> Event model cmd resp r -> ShowS #

show :: Event model cmd resp r -> String #

showList :: [Event model cmd resp r] -> ShowS #

execCmds :: forall model cmd m resp. StateMachine model cmd m resp -> Commands cmd resp -> [Event model cmd resp Symbolic] Source #

execCmds is just the repeated form of execCmd.

execHistory :: forall model cmd m resp. StateMachine model cmd m resp -> History cmd resp -> [Event model cmd resp Concrete] Source #