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

Copyright(C) 2017 Jacob Stanley
LicenseBSD-style (see the file LICENSE)
MaintainerStevan Andjelkovic <stevan@advancedtelematic.com>
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Test.StateMachine.Types.References

Description

This module contains reference related types. It's taken almost verbatim from the Hedgehog library.

Synopsis

Documentation

data Reference v a Source #

References are the potential or actual result of executing an action. They are parameterised by either Symbolic or Concrete depending on the phase of the test.

Symbolic variables are the potential results of actions. These are used when generating the sequence of actions to execute. They allow actions which occur later in the sequence to make use of the result of an action which came earlier in the sequence.

Concrete variables are the actual results of actions. These are used during test execution. They provide access to the actual runtime value of a variable.

Constructors

Reference (v a) 

Instances

HTraversable Reference Source # 

Methods

htraverse :: Applicative f => (forall a. g a -> f (h a)) -> Reference g b -> f (Reference h b) Source #

HFoldable Reference Source # 

Methods

hfoldMap :: Monoid m => (forall a. v a -> m) -> Reference v b -> m Source #

HFunctor Reference Source # 

Methods

hfmap :: (forall a. g a -> h a) -> Reference g b -> Reference h b Source #

(Eq1 v, Eq a) => Eq (Reference v a) Source # 

Methods

(==) :: Reference v a -> Reference v a -> Bool #

(/=) :: Reference v a -> Reference v a -> Bool #

(Ord1 v, Ord a) => Ord (Reference v a) Source # 

Methods

compare :: Reference v a -> Reference v a -> Ordering #

(<) :: Reference v a -> Reference v a -> Bool #

(<=) :: Reference v a -> Reference v a -> Bool #

(>) :: Reference v a -> Reference v a -> Bool #

(>=) :: Reference v a -> Reference v a -> Bool #

max :: Reference v a -> Reference v a -> Reference v a #

min :: Reference v a -> Reference v a -> Reference v a #

(Show a, Show1 v) => Show (Reference v a) Source # 

Methods

showsPrec :: Int -> Reference v a -> ShowS #

show :: Reference v a -> String #

showList :: [Reference v a] -> ShowS #

concrete :: Reference Concrete a -> a Source #

Take the value from a concrete variable.

opaque :: Reference Concrete (Opaque a) -> a Source #

Take the value from an opaque concrete variable.

newtype Opaque a Source #

Opaque values.

Useful if you want to put something without a Show instance inside something which you'd like to be able to display.

Constructors

Opaque 

Fields

Instances

Eq a => Eq (Opaque a) Source # 

Methods

(==) :: Opaque a -> Opaque a -> Bool #

(/=) :: Opaque a -> Opaque a -> Bool #

Ord a => Ord (Opaque a) Source # 

Methods

compare :: Opaque a -> Opaque a -> Ordering #

(<) :: Opaque a -> Opaque a -> Bool #

(<=) :: Opaque a -> Opaque a -> Bool #

(>) :: Opaque a -> Opaque a -> Bool #

(>=) :: Opaque a -> Opaque a -> Bool #

max :: Opaque a -> Opaque a -> Opaque a #

min :: Opaque a -> Opaque a -> Opaque a #

Show (Opaque a) Source # 

Methods

showsPrec :: Int -> Opaque a -> ShowS #

show :: Opaque a -> String #

showList :: [Opaque a] -> ShowS #

data Symbolic a where Source #

Symbolic values.

Constructors

Symbolic :: Typeable a => Var -> Symbolic a 

Instances

Eq1 Symbolic Source # 

Methods

liftEq :: (a -> b -> Bool) -> Symbolic a -> Symbolic b -> Bool #

Ord1 Symbolic Source # 

Methods

liftCompare :: (a -> b -> Ordering) -> Symbolic a -> Symbolic b -> Ordering #

Show1 Symbolic Source # 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Symbolic a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Symbolic a] -> ShowS #

Eq (Symbolic a) Source # 

Methods

(==) :: Symbolic a -> Symbolic a -> Bool #

(/=) :: Symbolic a -> Symbolic a -> Bool #

Ord (Symbolic a) Source # 

Methods

compare :: Symbolic a -> Symbolic a -> Ordering #

(<) :: Symbolic a -> Symbolic a -> Bool #

(<=) :: Symbolic a -> Symbolic a -> Bool #

(>) :: Symbolic a -> Symbolic a -> Bool #

(>=) :: Symbolic a -> Symbolic a -> Bool #

max :: Symbolic a -> Symbolic a -> Symbolic a #

min :: Symbolic a -> Symbolic a -> Symbolic a #

Typeable * a => Read (Symbolic a) Source # 
Show (Symbolic a) Source # 

Methods

showsPrec :: Int -> Symbolic a -> ShowS #

show :: Symbolic a -> String #

showList :: [Symbolic a] -> ShowS #

newtype Concrete a where Source #

Concrete values.

Constructors

Concrete :: a -> Concrete a 

Instances

Functor Concrete Source # 

Methods

fmap :: (a -> b) -> Concrete a -> Concrete b #

(<$) :: a -> Concrete b -> Concrete a #

Foldable Concrete Source # 

Methods

fold :: Monoid m => Concrete m -> m #

foldMap :: Monoid m => (a -> m) -> Concrete a -> m #

foldr :: (a -> b -> b) -> b -> Concrete a -> b #

foldr' :: (a -> b -> b) -> b -> Concrete a -> b #

foldl :: (b -> a -> b) -> b -> Concrete a -> b #

foldl' :: (b -> a -> b) -> b -> Concrete a -> b #

foldr1 :: (a -> a -> a) -> Concrete a -> a #

foldl1 :: (a -> a -> a) -> Concrete a -> a #

toList :: Concrete a -> [a] #

null :: Concrete a -> Bool #

length :: Concrete a -> Int #

elem :: Eq a => a -> Concrete a -> Bool #

maximum :: Ord a => Concrete a -> a #

minimum :: Ord a => Concrete a -> a #

sum :: Num a => Concrete a -> a #

product :: Num a => Concrete a -> a #

Traversable Concrete Source # 

Methods

traverse :: Applicative f => (a -> f b) -> Concrete a -> f (Concrete b) #

sequenceA :: Applicative f => Concrete (f a) -> f (Concrete a) #

mapM :: Monad m => (a -> m b) -> Concrete a -> m (Concrete b) #

sequence :: Monad m => Concrete (m a) -> m (Concrete a) #

Eq1 Concrete Source # 

Methods

liftEq :: (a -> b -> Bool) -> Concrete a -> Concrete b -> Bool #

Ord1 Concrete Source # 

Methods

liftCompare :: (a -> b -> Ordering) -> Concrete a -> Concrete b -> Ordering #

Show1 Concrete Source # 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Concrete a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Concrete a] -> ShowS #

Eq a => Eq (Concrete a) Source # 

Methods

(==) :: Concrete a -> Concrete a -> Bool #

(/=) :: Concrete a -> Concrete a -> Bool #

Ord a => Ord (Concrete a) Source # 

Methods

compare :: Concrete a -> Concrete a -> Ordering #

(<) :: Concrete a -> Concrete a -> Bool #

(<=) :: Concrete a -> Concrete a -> Bool #

(>) :: Concrete a -> Concrete a -> Bool #

(>=) :: Concrete a -> Concrete a -> Bool #

max :: Concrete a -> Concrete a -> Concrete a #

min :: Concrete a -> Concrete a -> Concrete a #

Show a => Show (Concrete a) Source # 

Methods

showsPrec :: Int -> Concrete a -> ShowS #

show :: Concrete a -> String #

showList :: [Concrete a] -> ShowS #

newtype Var Source #

Symbolic variable names.

Constructors

Var Int 

Instances

Eq Var Source # 

Methods

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

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

Num Var Source # 

Methods

(+) :: Var -> Var -> Var #

(-) :: Var -> Var -> Var #

(*) :: Var -> Var -> Var #

negate :: Var -> Var #

abs :: Var -> Var #

signum :: Var -> Var #

fromInteger :: Integer -> Var #

Ord Var Source # 

Methods

compare :: Var -> Var -> Ordering #

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

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

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

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

max :: Var -> Var -> Var #

min :: Var -> Var -> Var #

Read Var Source # 
Show Var Source # 

Methods

showsPrec :: Int -> Var -> ShowS #

show :: Var -> String #

showList :: [Var] -> ShowS #